samedi 31 janvier 2015

Custom Post Types and Pre Populated Custom Taxonomies


I'm building a custom post type that relies on three custom taxonomies. I'm registering all the custom posts and tax... using the init action (this works and I can manage the new aspects)



...
register_taxonomy( 'cppstrands', array( 'cppstatements' ), $args );
...

//Part of the cppmatrix_init method called here
add_action( 'init', 'cppmatrix_init', 0 );
...


I am also trying to prepopulate the tax.. with data when the plugin is activated using register_activation_hook but this fails as Taxonomy does not exist.



...
if(taxonomy_exists('cppstrands')) ...
...

//Part of the cppmatrix_dataInstall called here
register_activation_hook(__FILE__, 'cppmatrix_dataInstall');


I am suspecting that init happens before register_activation_hook but don't know what to do to solve it.


Can anyone help?


Thanks





Aucun commentaire:

Enregistrer un commentaire