WordPress.org

Make WordPress Core

Changeset 15772


Ignore:
Timestamp:
10/11/2010 03:16:45 AM (8 years ago)
Author:
nacin
Message:

Make it explicit that you can set fallback_cb to false in wp_nav_menu.

File:
1 edited

Legend:

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

    r15584 r15772  
    120120 * container_class - the class that is applied to the container. Defaults to 'menu-{menu slug}-container'.
    121121 * container_id - The ID that is applied to the container. Defaults to blank.
    122  * fallback_cb - If the menu doesn't exists, a callback function will fire. Defaults to 'wp_page_menu'.
     122 * fallback_cb - If the menu doesn't exists, a callback function will fire. Defaults to 'wp_page_menu'. Set to false for no fallback.
    123123 * before - Text before the link text.
    124124 * after - Text after the link text.
     
    169169    // If no menu was found or if the menu has no items and no location was requested, call the fallback_cb if it exists
    170170    if ( ( !$menu || is_wp_error($menu) || ( isset($menu_items) && empty($menu_items) && !$args->theme_location ) )
    171         && ( function_exists($args->fallback_cb) || is_callable( $args->fallback_cb ) ) )
     171        && $args->fallback_cb && ( function_exists($args->fallback_cb) || is_callable( $args->fallback_cb ) ) )
    172172            return call_user_func( $args->fallback_cb, (array) $args );
    173173
Note: See TracChangeset for help on using the changeset viewer.