0

I'm trying to build new wordpress plugin. Additional to the default wordpress categories box in the publishing screen of posts and pages, I want to add another box for custom taxonomy categories , How can I do that ?

1 Answer 1

0

All what you need to do is just pass required post types as array in the second parameter for register_taxonomy function call:

add_action( 'init', 'wpse8170_init' );
function wpse8170_init() {
    register_taxonomy( 'my-taxonomy', array( 'post' ), array(
        ...
    ) );

    // or call this function if your taxonomy is already registered
    register_taxonomy_for_object_type( 'my-taxonomy', 'page' );
}
2
  • Thanks Eugene, what if the taxonomies are registered in another plugin ? Jan 31, 2013 at 10:00
  • @WaseemAbuSenjer I have updated my snippet. Jan 31, 2013 at 10:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.