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
- How to change a user’s password programatically
- How to delete custom taxonomy terms in plugin’s uninstall.php?
- translation does not work with text_domain
- Many plugins making WordPress run slow by design?
- How can i get the post’s full html source by its ID?
- How to change the name of the “edit my profile” link in the WordPress admin backend
- add seperate suffix for low price and high price in woocommerce
- Class or function wrapper for plugin code
- Licensing a Plugin [closed]
- Add a function call after content automatically?
- wp_post not working, keeps redirecting to posts page
- Is it possible to create duplicate post on other site (either push, on publish, or pull, periodically)?
- A more elegant way to handle notices/warnings
- appointment plugin doesn’t display all appointments
- Doing action based on input from options menu
- What are the downsides of using bootstrap in plugin development?
- WP Elementor Pro causing crtical failure on website