Make WordPress Core


Ignore:
Timestamp:
04/28/2010 08:44:08 PM (16 years ago)
Author:
nacin
Message:

Fix handling of nav menu search, also menu naming conflicts. props filosofo, fixes #13138

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/nav-menu.php

    r14283 r14285  
    217217                's' => $query,
    218218            ));
     219            if ( ! have_posts() )
     220                    echo '-1';
    219221            while ( have_posts() ) {
    220222                the_post();
     
    237239                'number' => 10,
    238240            ));
     241            if ( empty( $terms ) || is_wp_error( $terms ) )
     242                echo '-1';
    239243            foreach( (array) $terms as $term ) {
    240244                if ( 'markup' == $response_format ) {
     
    532536                echo walk_nav_menu_tree( array_map('wp_setup_nav_menu_item', $search_results), 0, (object) $args );
    533537                ?>
     538            <?php elseif ( is_wp_error( $search_results ) ) : ?>
     539                <li><?php echo $search_results->get_error_message(); ?></li>
     540            <?php elseif ( ! empty( $searched ) ) : ?>
     541                <li><?php _e('No results found.'); ?></li>
    534542            <?php endif; ?>
    535543            </ul>
     
    699707                echo walk_nav_menu_tree( array_map('wp_setup_nav_menu_item', $search_results), 0, (object) $args );
    700708                ?>
     709            <?php elseif ( is_wp_error( $search_results ) ) : ?>
     710                <li><?php echo $search_results->get_error_message(); ?></li>
     711            <?php elseif ( ! empty( $searched ) ) : ?>
     712                <li><?php _e('No results found.'); ?></li>
    701713            <?php endif; ?>
    702714            </ul>
Note: See TracChangeset for help on using the changeset viewer.