mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 17:48:01 +01:00
Set nopaging for the wp_get_nav_menu_items() get_posts() call to avoid pointless found rows queries. see #13134
git-svn-id: http://svn.automattic.com/wordpress/trunk@14297 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
8dbbe467dc
commit
ce7b2b4f58
@ -408,7 +408,7 @@ function wp_get_nav_menu_items( $menu, $args = array() ) {
|
||||
$items = get_objects_in_term( $menu->term_id, 'nav_menu' );
|
||||
|
||||
if ( ! empty( $items ) ) {
|
||||
$defaults = array( 'order' => 'ASC', 'orderby' => 'menu_order', 'post_type' => 'nav_menu_item', 'post_status' => 'publish', 'output' => ARRAY_A, 'output_key' => 'menu_order' );
|
||||
$defaults = array( 'order' => 'ASC', 'orderby' => 'menu_order', 'post_type' => 'nav_menu_item', 'post_status' => 'publish', 'output' => ARRAY_A, 'output_key' => 'menu_order', 'nopaging' => true );
|
||||
$args = wp_parse_args( $args, $defaults );
|
||||
if ( count( $items ) > 1 )
|
||||
$args['include'] = implode( ',', $items );
|
||||
|
Loading…
Reference in New Issue
Block a user