Filter hook 'install_plugins_nonmenu_tabs'

in WP Core File wp-admin/includes/class-wp-plugin-install-list-table.php at line 144

View Source

install_plugins_nonmenu_tabs

Filter Hook
Description
Filters tabs not associated with a menu item on the Add Plugins screen.

Hook Information

File Location wp-admin/includes/class-wp-plugin-install-list-table.php View on GitHub
Hook Type Filter
Line Number 144

Hook Parameters

Type Name Description
string[] $nonmenu_tabs The tabs that don't have a menu item on the Add Plugins screen.

Usage Examples

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

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

Source Code Context

wp-admin/includes/class-wp-plugin-install-list-table.php:144 - How this hook is used in WordPress core
<?php
 139  		 *
 140  		 * @since 2.7.0
 141  		 *
 142  		 * @param string[] $nonmenu_tabs The tabs that don't have a menu item on the Add Plugins screen.
 143  		 */
 144  		$nonmenu_tabs = apply_filters( 'install_plugins_nonmenu_tabs', $nonmenu_tabs );
 145  
 146  		// If a non-valid menu tab has been selected, And it's not a non-menu action.
 147  		if ( empty( $tab ) || ( ! isset( $tabs[ $tab ] ) && ! in_array( $tab, (array) $nonmenu_tabs, true ) ) ) {
 148  			$tab = key( $tabs );
 149  		}

PHP Documentation

<?php
/**
		 * Filters tabs not associated with a menu item on the Add Plugins screen.
		 *
		 * @since 2.7.0
		 *
		 * @param string[] $nonmenu_tabs The tabs that don't have a menu item on the Add Plugins screen.
		 */
Quick Info
  • Hook Type: Filter
  • Parameters: 1
  • File: wp-admin/includes/class-wp-plugin-install-list-table.php
Related Hooks

Related hooks will be displayed here in future updates.