My custom post types don’t show up in multisite admin panels
-
Hi. Let me start with my code first off…
function wuss_games_post() { $labels = array( 'name' => _x( 'WUSS Game', 'Post Type General Name', 'text_domain' ), 'singular_name' => _x( 'WUSS Game', 'Post Type Singular Name', 'text_domain' ), 'menu_name' => __( 'WUSS Games', 'text_domain' ), 'parent_item_colon' => __( 'Parent Game:', 'text_domain' ), 'all_items' => __( 'All Games', 'text_domain' ), 'view_item' => __( 'View WUSS Game', 'text_domain' ), 'add_new_item' => __( 'Add New WUSS Game', 'text_domain' ), 'add_new' => __( 'Add New', 'text_domain' ), 'edit_item' => __( 'Edit WUSS Game', 'text_domain' ), 'update_item' => __( 'Update WUSS Game', 'text_domain' ), 'search_items' => __( 'Search WUSS Game', 'text_domain' ), 'not_found' => __( 'Not found', 'text_domain' ), 'not_found_in_trash' => __( 'Not found in Trash', 'text_domain' ), ); $rewrite = array( 'slug' => 'wuss_game', 'with_front' => true, 'pages' => true, 'feeds' => true, ); $args = array( 'label' => __( 'wuss_game', 'text_domain' ), 'description' => __( 'WUSS Games', 'text_domain' ), 'labels' => $labels, 'supports' => array( 'title', 'editor', 'excerpt', 'thumbnail', 'custom-fields'), 'hierarchical' => true, 'public' => true, 'show_ui' => true, 'show_in_menu' => "wuss_framework", 'show_in_nav_menus' => true, 'show_in_admin_bar' => true, 'can_export' => false, 'has_archive' => false, 'exclude_from_search' => false, 'publicly_queryable' => true, 'rewrite' => $rewrite, 'capability_type' => 'page', ); register_post_type( 'wuss_game', $args ); } add_action( 'init', 'wuss_games_post', 0 );
Right, now, the problem. When I activate my plugin my top level menu is created just fine:
if (is_multisite()) { add_action( 'network_admin_menu', 'register_wuss_framework', 5 ); } else { add_action( 'admin_menu', 'register_wuss_framework', 5 ); } function register_wuss_framework() { add_menu_page("WORDPRESS UNITY SOCIAL SYSTEM", "WUSS", "manage_wuss", "wuss_framework", "show_wuss_framework",'dashicons-smiley'); do_action('register_subsystems',12); }
This creates the WUSS menu as I intended. My plugin is set to only appear in the Network Admin page and there the WUSS menus displays just fine. When I use a single site install, the post type above appears as a sub-menu of the WUSS menu, as expected. When I install this on a multisite, the custom post type does not appear in the menus. Why not?
I tried setting the plugin to show up on individual sites also and that allows me to activate the plugin on the sub-site but the menu still appears in the network dashboard without the custom post type.
I tried moving the custom post type into the function that gets called during init and have it load before or after function has done it’s thing but still no custom post type.
I tried manually entering the post type into the URL so I can see if I can make posts and that works just fine. Also, by tinkering with the code I posted at the top I was able to get the custom post type to appear on the site’s admin panel but that is the ONLY place where I can actually see the custom post type and edit it.
Problem is that I do not want it editable on a site by site basis. I want to do a network activate and then have the custom post type appear underneath my custom menu on the network admin dashboard just like the main menu does. Why can I not do this?
Am I doing something wrong or is this simply something that is not supported ?
Thanks
- The topic ‘My custom post types don’t show up in multisite admin panels’ is closed to new replies.