Changeset 15075
- Timestamp:
- 05/31/2010 02:54:50 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/admin-ajax.php
r15047 r15075 834 834 'after' => '', 835 835 'before' => '', 836 'context' => 'backend',837 836 'link_after' => '', 838 837 'link_before' => '', -
trunk/wp-includes/nav-menu-template.php
r15034 r15075 199 199 * depth - how many levels of the hierarchy are to be included. 0 means all. Defaults to 0. 200 200 * walker - allows a custom walker to be specified. 201 * context - the context the menu is used in.202 201 * 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. 203 202 * … … 210 209 $defaults = array( 'menu' => '', 'container' => 'div', 'container_class' => '', 'container_id' => '', 'menu_class' => 'menu', 211 210 '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' => '' ); 213 212 214 213 $args = wp_parse_args( $args, $defaults ); … … 238 237 $menu_items = wp_get_nav_menu_items( $menu->term_id ); 239 238 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 ) ) ) 243 242 return call_user_func( $args->fallback_cb, (array) $args ); 244 }245 }246 243 247 244 // If no fallback function was specified and the menu doesn't exists, bail. … … 259 256 260 257 // 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 ); 263 259 264 260 $sorted_menu_items = array(); … … 310 306 311 307 /** 312 * Add the class property classes for the current frontendcontext, if applicable.308 * Add the class property classes for the current context, if applicable. 313 309 * 314 310 * @access private
Note: See TracChangeset
for help on using the changeset viewer.