Wordpress - get_terms() returns “invalid taxonomy” (this is not a hook issue)

后端 未结 1 418
无人共我
无人共我 2020-12-04 02:48

On my local machine it works fine, but on the live server, when I run

get_terms(\'taxonomy\' => \'any_taxonomy\');

it returns a list of

相关标签:
1条回答
  • 2020-12-04 03:21

    i'd say you are running different versions of wordpress, 4.5 changed the functionality of get_terms()

     get_terms(  array('taxonomy' => 'any_taxonomy','hide_empty' => false) );
    

    Should work, but i also think if you are calling get_terms() before registering your taxonomy is going to cause issues.

    0 讨论(0)
提交回复
热议问题