You appear to be a bot. Output may be restricted
Description
Filter to search menu items.
Usage
$array = Test_WP_Customize_Nav_Menus::filter_search( $items, $args );
Parameters
- $items
- ( array ) required – Items.
- $args
- ( array ) required – { Search args.
- $pagenum
- ( int ) required – Page number.
- $s
- ( string ) required – Search string. }
Returns
array Items.
Source
File name: wordpress-develop-tests/phpunit/tests/customize/nav-menus.php
Lines:
1 to 23 of 23
public function filter_search( $items, $args ) { $this->assertIsArray( $items ); $this->assertIsArray( $args ); $this->assertArrayHasKey( 's', $args ); $this->assertArrayHasKey( 'pagenum', $args ); $this->filter_count_customize_nav_menu_searched_items += 1; if ( 'cat' === $args['s'] ) { array_unshift( $items, array( 'id' => 'home', 'title' => 'COOL CAT!', 'type' => 'custom', 'type_label' => __( 'Custom Link' ), 'object' => '', 'url' => home_url( '/cool-cat' ), ) ); } return $items; }