WebDevStudios / Taxonomy_Core

A tool to make custom taxonomy registration just a bit simpler. Automatically registers taxonomy labels, and provides helpful methods.
38 stars 11 forks source link

fix for use the library standalone in a plugin #6

Closed Mte90 closed 9 years ago

Mte90 commented 9 years ago

I use Taxonomy Core included in a plugin, without the priority the l10n support is not loaded.

jtsternberg commented 9 years ago

Can you try a higher priority like 9?

Mte90 commented 9 years ago

I've do it some tests, the best solution is:

add_action( 'init', array( $this, 'l10n' ), 5 );
add_action( 'init', array( $this, 'register_taxonomy' ), 5);

Use plugins_loaded is not the correct way because the plugin that calls can be executed before the library. With this priority, the l10n files are loaded and the cpt are translated correctly.

jtsternberg commented 9 years ago

I understand the 'init' hook usage. I'm just requesting that you don't do it so early, at a priority of 5. 9 is still earlier than standard, but still gives many levels of priority before it, in case it is needed for any reason. I guess I'm just not sure why you chose 5 as the priority?

Mte90 commented 9 years ago

i've choosen 5 respect to 9 because is used already in the code of Taxonomy_Core