Support

Account

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

  • Hi @digitalquery

    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 🙂