Home › Forums › Feedback › Consider filtering get_option calls to support get_option use for termdata › Reply To: Consider filtering get_option calls to support get_option use for termdata
Because get_options()
is a WordPress core function, I’m afraid there’s nothing we can do with it. By using that function instead of the get_field()
, the developer should be aware of the limitation of the function.
A workaround for that is you can try using the “option_” hook to alter the data. So if your taxonomy slug is “customtax”, the term ID is “99”, and the field name is “field_name”, then you can do it like this:
add_filter( 'option_customtax_99_field_name', 'my_alter_option' );
function my_alter_option($option){
// do something here
// return
return $option;
}
I hope this makes sense 🙂
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.