-
Notifications
You must be signed in to change notification settings - Fork 29
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
get_field on term #32
Comments
Hello @danygit, Thank you for the report. It seems something serious. I will be watching this soon, then. |
Hello @MaximeCulea First, Thank you for this amazing plugin. i'm facing the same probleme
@danygit have you fixed it ? Thank you My Configuration |
No i dont use this plugin. I do it myself with my own code. |
Okey Thank you, do you have a hint how you did it ? i'm try to fix it in the plugin, otherwise i'll do in with my own code |
You add acf field in option page with argument variable language in key
And to retrieve the option field = get_field('toto', 'options');
|
Thank you for the fast reply, i found the source of the bug, it happens only when i get_field from a term for exemple i use this code to get a field (link) added to woocommerce product category according to ACF docs there are 3 ways to get a field from a taxonomy im using the 3rd The bug occures when calling get_field on a taxonomy, i'm passing the object WP_Term as the second param. the function that throws the exceptipn can't handle the object because it's expecting a string. To fix this use the 1st or 2nd way to retrieve the field Another fix i'm using currently as i can't fix erros one by one is to add a test and the function becomes Edit the file
|
Wow, thank you guys for the hint! And sorry for the delay (because of holidays). |
Anytime @MaximeCulea Merci de nous dire une fois le fix est en place que je puisse mettre à jour le plugin. Merci & bonnes vacances. |
Thanks for the fix @Deithso. I'm hoping @MaximeCulea can import the fix into the plugin soon. |
Version information
Steps to reproduce
What was expected
No error
What happened instead
( ! ) Catchable fatal error: Object of class WP_Term could not be converted to string in /var/www/html/web/wp-content/plugins/acf-options-for-polylang/classes/helpers.php on line 16
My opinion
add_filter( 'acf/validate_post_id', [ $this, 'set_options_id_lang' ], 10, 2 );
Filter is deprecated and dont work with acf term field.
The text was updated successfully, but these errors were encountered: