• Adding the following in add_meta_boxes enables the category taxonomy for any custom post type.

    foreach(get_post_types() as $post_type) {
      $exclude = array("wp-types-group", "wp-types-user-group", "post", "page", "attachment", "revision", "nav_menu_item");
      if ( in_array($post_type, $exclude) )
        continue;
      if (!is_object_in_taxonomy($post_type, 'category')){
        register_taxonomy_for_object_type('category', $post_type);
      }
    }

    http://wordpress.org/plugins/minimu/

Viewing 1 replies (of 1 total)
  • Plugin Author shelkie

    (@shelkie)

    Thanks for the input! I’ll add your suggestions and push out a new version shortly.

    Cheers,
    Eric.

Viewing 1 replies (of 1 total)
  • The topic ‘Auto register 'category' for any custom post type’ is closed to new replies.