customize_nav_menu_available_items filter-hookWP 4.3.0

Filters the available menu items.

Usage

add_filter( 'customize_nav_menu_available_items', 'wp_kama_customize_nav_menu_available_items_filter', 10, 4 );

/**
 * Function for `customize_nav_menu_available_items` filter-hook.
 * 
 * @param array  $items       The array of menu items.
 * @param string $object_type The object type.
 * @param string $object_name The object name.
 * @param int    $page        The current page number.
 *
 * @return array
 */
function wp_kama_customize_nav_menu_available_items_filter( $items, $object_type, $object_name, $page ){

	// filter...
	return $items;
}
$items(array)
The array of menu items.
$object_type(string)
The object type.
$object_name(string)
The object name.
$page(int)
The current page number.

Changelog

Since 4.3.0 Introduced.

Where the hook is called

WP_Customize_Nav_Menus::load_available_items_query()
customize_nav_menu_available_items
wp-includes/class-wp-customize-nav-menus.php 300
$items = apply_filters( 'customize_nav_menu_available_items', $items, $object_type, $object_name, $page );

Where the hook is used in WordPress

Usage not found.