-
-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changed behaviour of get_queried_object #264
Comments
you can try tweaking the priority on https://github.com/Log1x/acf-composer/blob/master/src/AcfComposer.php#L101 – is it a custom taxonomy? |
Thanks for the suggestion, no luck with tweaking the priority though. |
You're going to have to give more info then. How are they custom? How are you registering them? What hooks are they in? Even if you change from You can also surf the code diff at #193 but a good bit more has changed since then. I also don't 100% understand your issue without seeing code. What do you mean by changing the output of |
Yeah sure. So one taxonomy, the 'route' one in the URL structure mentioned, is actually a woocommerce tax 'product_cat' ( sorry mistakenly thought it was custom for some reason ). The other taxonomy is custom and registered using poet (2.1.0) - this is also registered against the woocommerce 'product' post type. This is the poet config for that tax:
In terms of the get_queried_object call, that happens in a sage view component class that is used to filter products by both taxonomy terms in some specific instances. Not sure if that helps -- happy to share more ocde if necessary. I've tried changing acf/init to init but no luck with that either. Will take a look through the diff tomorrow for any more clues. |
I'm not really sure, especially without seeing any of the object code. Perhaps try tweaking this change from Poet? I find this all a little strange as the combined changes with the latest Poet and ACF Composer v3 increased compatibility for me quite a bit, especially when trying to dynamically create fields inside of field groups/blocks – but I also do everything in my power to avoid WooCommerce. 😆 |
Had a chance to take another look this morning and turns out switching the poet hookPriority to 5 fixes the issue. |
If you add |
Sorry if this is a bit vague but I've run into an issue after upgrading from version 2 to 3 that seems to effect the behaviour of get_queried_object.
I have a taxonomy archive page that also allows filtering posts by a secondary taxonomy and term - the URL structure looks like:
https://example.com/taxonmy_a/term?taxonomy_b=term
Using version 2 of acf-composer, get_queried_object returns the term of taxonomy_a as I would expect whereas when using version 3, get_queried_object now returns the term of taxonomy_b.
I'm not quite sure why thats happening but for now I've rolled back to v2 -- is there something I've not considered about the updated functionality?
The text was updated successfully, but these errors were encountered: