Support » Plugin: Advanced Custom Fields: Extended » functions.php called before ACF Extended Taxonomy?

  • Resolved mountbatt

    (@mountbatt)


    Hi,

    i created a taxonomy with ACF Extended and tried to use functions like get_term_by() etc. to get values from that taxonomy. But the output told me, that my custom taxonomy is unknown or does not exist.

    When I export and paste the same taxonomy function code into my functions.php, the taxonomy gets recognized by my get_term_by() etc.

    So in my understanding this shows me, that the taxonomy creation of ACF Extended comes AFTER(!) the functions in my functions.php.

    Is there any way to change that?

    Thanks!
    Tobias

Viewing 1 replies (of 1 total)
  • Plugin Author hwk-fr

    (@hwk-fr)

    Hello,

    Thanks for the feedback and sorry for the late answer! The ACF Extended Dynamic Taxonomies are registered within the init:10 hook, as recommended in the register_taxonomy() documentation:

    Note: Do not use before the ‘init’ hook.

    In your functions.php, you probably registered your taxonomy at the root level of the file (and not within the init hook) which should be avoided. Your get_term_by() call should also be used after that init hook (which is pretty high anyway).

    Hope it helps!

    Regards.

Viewing 1 replies (of 1 total)
  • The topic ‘functions.php called before ACF Extended Taxonomy?’ is closed to new replies.