f(x) Photo Tag Admin Page When I write f(x) Photo Tag plugin, I think it’s best to put the menu under “Media” because it’s simpler, and also make sense. Sometimes we want to add custom post type admin menu as sub-menu item on other post type or under settings page, because it make sense (not all post type need to be parent menu), and I like this approach because it make WordPress Admin cleaner. And Here’s how I do that: #1. Disable CPT Menu When registering your custom post type, simply change the show_in_menu args as false. register_post_type( 'your-cpt', array(     'description'           => '',     'public'                => true,     'show_ui'               => true,     'show_in_menu'          => false, /* Do not show admin menu */     [...] ) ); Now, your CPT will have no link in admin menu. Note: before you remove the menu, copy the link of your edit post type menu item, we will add that link in second step. Your menu link should be something like: http://your-site/wp-admin/edit.php?post_type=your-cpt The part we are using is edit.php?post_type=your-cpt as menu slug in add_submenu_page() function. #2. Add Sub Menu in Preferred Parent Menu Item It’s very simple, we simply need
Share This