When you register the custom post type, you can control whether the menu item appears with the show_in_menu
arg. You could do something like the following ( this has not been tested ):
// create a constant to store the ID of the blog where the menu should be hidden.
define('HIDDEN_MENU_BLOG_ID', 1 );
function codex_custom_init() {
$show_in_menus = ( HIDDEN_MENU_BLOG_ID === get_current_blog_id() ) ? false : true;
$args = array(
'public' => true,
'label' => 'Books'
'show_in_menu' => $show_in_menus,
);
register_post_type( 'book', $args );
}
add_action( 'init', 'codex_custom_init' );
This is not very scalable however, you may want to couple this with an admin screen where a super-admin can choose which blogs to hide the menu from.
Hope this helps!
Related Posts:
- How to Add a Third Level Sub Menu to the WordPress Admin Menu
- Hide Theme options and Customize Admin menu
- Admin menu hilighting wrong item for CPT
- Add custom fields in the new and edit the site forms without touching the WP core
- Submitting form to admin-post.php WordPress
- Making my plugin multi-site compatible
- How to stop showing admin notice after close button has been clicked
- Admin menu as submenu from another plugin
- Is There a WordPress Hook to Filter the Edit Posts View?
- Creating a WordPress admin page without a menu for a plugin
- Removing an admin page added by a 3rd party plugin. Gravity forms in this example
- Is there any record of installed plugins in the database?
- Add content to /wp-admin/plugin-install.php admin screens
- Custom admin column disappearing when using Quick Edit [duplicate]
- Getting Custom Post Type content from main-site of a Multisite
- How do I add a widget programmatically to a newly created site (WPMU) within a plugin?
- Plugin development: how to create a form and get custom data?
- Plugin Development: WordPress processes twice on post update. How to skip process on the first?
- how to not show plugin in admin area
- Master menu item for multiple plugins?
- WordPress network: set themes and plugins for new blog
- How to make a WP admin button/menu similar to Jetpack Notifications?
- wp_verify_nonce() why return false?
- Detecting when a custom taxonomy has been changed and display alert?
- What is the function to get plugin base url in multisite?
- Having separate plugins and themes folder for multi-site setup
- How could I execute my plugin just in frontend (not in backend)
- Custom height/width for thickbox in WP Backend
- Is it possible to set up multistore in Woocommerce? [closed]
- Cannot access wp-admin after disabling all plugin
- ‘wp_login’ action hook not working with wp-login.php file
- How to define WordPress plugin shortcode globally for multisite?
- How to add class in plugin only for network site?
- How to write a plugin to add users to a mail list
- White page on custom plugin option submit
- WordPress on AWS with ELB
- All Users > User List > Update User Meta Field Inline
- Polylang : Interverting languages after development [closed]
- Suggestions on Approach to New Plugin I’m Stuck On
- Create tabs in admin options page from custom post type loop
- Dynamic admin submenu
- Add menu page issues (permissions & position)
- Redirect to another page using contact form 7? [closed]
- Network activating; if ( !current_user_can( ‘manage_options’ ) ) locks me out…
- Certain functions are undefined when called form mu-plugins
- WordPress Multisite: Programmatically Activate / Deactivate a Plugin of a Specific Blog
- How to make multiple admin pages for one plugin?
- creating a plug in that would tap into save/update action of posts [closed]
- Display Plugin Panels Outside of Admin Areas
- How to display terms and conditions in post area?
- Why WP_Screeen doesn’t show all options with admin_body_class
- add_submenu_page returns null
- WordPress Site is Broken, Cannot see wp-admin page [closed]
- How do I add an options page at the bottom of the list?
- Is there a better way of handling AJAX requests in WordPress?
- Redirect Plugins.php to New Plugin Page
- How to get values from network settings panel?
- I cannot include a file in my plugin settings page
- Activation flow of a plugin in a multisite environment
- force logged in user to stay in the dashboard
- How can we get this dynamically as this folder may not be by the same name always → wp-admin
- WP Forms not displaying,becomming an fatal error
- Fatal error: require_once(): Failed opening required
- How to properly enqueue jQuery knob on WordPress without conflict?
- How to capture hidden values with Gravity Forms
- Creating one user access account for all the multiple sites
- Is admin section completely customizable in terms of styling?
- Store admin page into variable
- Why my multisite is this slow? (stats inside)
- Coming soon pages with rest of site in maintenance mode
- How to add submenu to WordPress plugin in the same Directory of main Plugin?
- Force Network Activated Plugin to Run After Site Level Plugins
- How can I pass value to function in add_menu_page?
- Getting 404 page not found error while trying to access add new plugin / themes
- How to set the default options on an existing plugin in a WP MU new user install
- Check if user is in a group of another site within multisite network [closed]
- Plugin menu replaced by another plugin?
- Active Plugins for current blog in WP Multisite Network? [duplicate]
- Ajax in Plugins: returns the whole page
- Gutenberg: Dynamic Block – Show saved data in the editor
- Combining JS files to one script
- The Admin page isn’t showing in the sidebar of the dashboard
- warning wp session
- Form submission issue in wordpress admin (custom plugin) using $_GET for searching & filtering
- redirect logged users to custom front-end insetad of wp-admin
- Remove custom menu pages for admin users
- 403 forbidden error in the admin panel as well as on the admin-ajax.php file
- media_sideload_image only works on localhost and without return id or src
- Sanitize $_GET variable when comparing
- Where can I save plugin data?
- wp_enqueue_style on template_redirect level?
- Save user total active time after login in wordpress [closed]
- Add a “View all” button on WooCommerce product archives pages
- Built a second plugin but it overwrote the first one
- WordPress gtag.js with User ID tracking
- Creating a functionality plugin to edit seriously simple podcasting
- Override plugin class which has namespace
- Plugin temporary files and files to download via FTP
- Is there a script to collect all hooks and filters provided by a plugin?
- WordPress super admin login issue. (Automatically logout)