Make WordPress Core

Changeset 15075


Ignore:
Timestamp:
05/31/2010 02:54:50 PM (15 years ago)
Author:
nacin
Message:

Remove vestigial 'context' code for wp_nav_menu. This was used when we used to use the same function as a theme template tag and admin template function (now we don't.) fixes #13656.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/admin-ajax.php

    r15047 r15075  
    834834            'after' => '',
    835835            'before' => '',
    836             'context' => 'backend',
    837836            'link_after' => '',
    838837            'link_before' => '',
  • trunk/wp-includes/nav-menu-template.php

    r15034 r15075  
    199199 * depth - how many levels of the hierarchy are to be included.  0 means all.  Defaults to 0.
    200200 * walker - allows a custom walker to be specified.
    201  * context - the context the menu is used in.
    202201 * theme_location - the location in the theme to be used.  Must be registered with register_nav_menu() in order to be selectable by the user.
    203202 *
     
    210209    $defaults = array( 'menu' => '', 'container' => 'div', 'container_class' => '', 'container_id' => '', 'menu_class' => 'menu',
    211210    'echo' => true, 'fallback_cb' => 'wp_page_menu', 'before' => '', 'after' => '', 'link_before' => '', 'link_after' => '',
    212     'depth' => 0, 'walker' => '', 'context' => 'frontend', 'theme_location' => '' );
     211    'depth' => 0, 'walker' => '', 'theme_location' => '' );
    213212
    214213    $args = wp_parse_args( $args, $defaults );
     
    238237        $menu_items = wp_get_nav_menu_items( $menu->term_id );
    239238
    240     // If no menu was found or if the menu has no items, call the fallback_cb
    241     if ( !$menu || is_wp_error($menu) || ( isset($menu_items) && empty($menu_items) ) ) {
    242         if ( 'frontend' == $args->context && ( function_exists($args->fallback_cb) || is_callable( $args->fallback_cb ) ) ) {
     239    // If no menu was found or if the menu has no items, call the fallback_cb if it exists
     240    if ( ( !$menu || is_wp_error($menu) || ( isset($menu_items) && empty($menu_items) ) )
     241        && ( function_exists($args->fallback_cb) || is_callable( $args->fallback_cb ) ) )
    243242            return call_user_func( $args->fallback_cb, (array) $args );
    244         }
    245     }
    246243
    247244    // If no fallback function was specified and the menu doesn't exists, bail.
     
    259256
    260257    // Set up the $menu_item variables
    261     if ( 'frontend' == $args->context )
    262         _wp_menu_item_classes_by_context( $menu_items );
     258    _wp_menu_item_classes_by_context( $menu_items );
    263259
    264260    $sorted_menu_items = array();
     
    310306
    311307/**
    312  * Add the class property classes for the current frontend context, if applicable.
     308 * Add the class property classes for the current context, if applicable.
    313309 *
    314310 * @access private
Note: See TracChangeset for help on using the changeset viewer.