Filter hook 'mu_menu_items'

in WP Core File wp-admin/network/settings.php at line 507

View Source

mu_menu_items

Filter Hook
Description
Filters available network-wide administration menu options. Options returned to this filter are output as individual checkboxes that, when selected, enable site administrator access to the specified administration menu in certain contexts. Adding options for specific menus here hinges on the appropriate checks and capabilities being in place in the site dashboard on the other side. For instance, when the single default option, 'plugins' is enabled, site administrators are granted access to the Plugins screen in their individual sites' dashboards.

Hook Information

File Location wp-admin/network/settings.php View on GitHub
Hook Type Filter
Line Number 507

Hook Parameters

Type Name Description
string[] $admin_menus Associative array of the menu items available.

Usage Examples

Basic Usage
<?php
// Hook into mu_menu_items
add_filter('mu_menu_items', 'my_custom_filter', 10, 1);

function my_custom_filter($admin_menus) {
    // Your custom filtering logic here
    return $admin_menus;
}

Source Code Context

wp-admin/network/settings.php:507 - How this hook is used in WordPress core
<?php
 502  		 *
 503  		 * @since MU (3.0.0)
 504  		 *
 505  		 * @param string[] $admin_menus Associative array of the menu items available.
 506  		 */
 507  		$menu_items = apply_filters( 'mu_menu_items', array( 'plugins' => __( 'Plugins' ) ) );
 508  
 509  		if ( $menu_items ) :
 510  			?>
 511  			<h2><?php _e( 'Menu Settings' ); ?></h2>
 512  			<table id="menu" class="form-table">

PHP Documentation

<?php
/**
		 * Filters available network-wide administration menu options.
		 *
		 * Options returned to this filter are output as individual checkboxes that, when selected,
		 * enable site administrator access to the specified administration menu in certain contexts.
		 *
		 * Adding options for specific menus here hinges on the appropriate checks and capabilities
		 * being in place in the site dashboard on the other side. For instance, when the single
		 * default option, 'plugins' is enabled, site administrators are granted access to the Plugins
		 * screen in their individual sites' dashboards.
		 *
		 * @since MU (3.0.0)
		 *
		 * @param string[] $admin_menus Associative array of the menu items available.
		 */
Quick Info
  • Hook Type: Filter
  • Parameters: 1
  • File: wp-admin/network/settings.php
Related Hooks

Related hooks will be displayed here in future updates.