taxonomy_exists always return false even the taxonomie exist

WordPress function taxonomy_exists that verifies the existence of taxonomy always returns false.

 $tax = taxonomy_exists('categorie-video');
 error_log('verify the existence of taxonomy = ' . json_encode($tax));

I used Simple Taxonomy plugin to create the taxonomy.

Related posts

1 comment

  1. This depends on the place where you are calling the taxonomy_exists() function.

    Taxonomies are created on init hook.
    So, calling taxonomy_exists() before init hook will return false because any taxonomy has not been initialized yet.

Comments are closed.