Ticket #27042: nav-menu.php.patch
File nav-menu.php.patch, 1.5 KB (added by , 11 years ago) |
---|
-
htdocs/wp-admin/includes/nav-menu.php
387 387 } 388 388 389 389 } 390 391 } elseif ( preg_match('/quick-search-(posttype|taxonomy)-([a-zA-Z_-]*\b)/', $type, $matches) ) { 390 } elseif ( preg_match('/quick-search-(posttype|taxonomy)-([a-zA-Z_-]*\b)/', $type, $matches ) ) { 392 391 if ( 'posttype' == $matches[1] && get_post_type_object( $matches[2] ) ) { 393 query_posts( array(392 query_posts( array( 394 393 'posts_per_page' => 10, 395 394 'post_type' => $matches[2], 396 395 's' => $query, 397 ) );398 if ( ! have_posts() ) 396 ) ); 397 if ( ! have_posts() ) { 399 398 return; 399 } 400 400 401 while ( have_posts() ) { 401 the_post(); 402 global $post; 403 global $wp_query; 404 $post = $wp_query->next_post(); 405 setup_postdata( $post ); 406 402 407 if ( 'markup' == $response_format ) { 403 408 $var_by_ref = get_the_ID(); 404 409 echo walk_nav_menu_tree( array_map('wp_setup_nav_menu_item', array( get_post( $var_by_ref ) ) ), 0, (object) $args ); … … 422 427 return; 423 428 foreach( (array) $terms as $term ) { 424 429 if ( 'markup' == $response_format ) { 425 echo walk_nav_menu_tree( array_map( 'wp_setup_nav_menu_item', array( $term ) ), 0, (object) $args );430 echo walk_nav_menu_tree( array_map( 'wp_setup_nav_menu_item', array( $term ) ), 0, (object) $args ); 426 431 } elseif ( 'json' == $response_format ) { 427 432 echo json_encode( 428 433 array(