Make WordPress Core

Changeset 40969


Ignore:
Timestamp:
06/30/2017 04:48:20 AM (7 years ago)
Author:
DrewAPicture
Message:

Docs: Clarify accepted types and values for $menu parameters in several contexts:

  • wp_nav_menu()
  • wp_get_nav_menu_object() and its filter wp_get_nav_menu_object
  • is_nav_menu()
  • wp_delete_nav_menu()
  • wp_get_nav_menu_items()

Props dimadin.
Fixes #38166.

Location:
trunk/src/wp-includes
Files:
2 edited

Legend:

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

    r40658 r40969  
    2222 *     Optional. Array of nav menu arguments.
    2323 *
    24  *     @type int|string|WP_Term $menu            Desired menu. Accepts (matching in order) id, slug, name, menu object. Default empty.
     24 *     @type int|string|WP_Term $menu            Desired menu. Accepts a menu ID, slug, name, or object. Default empty.
    2525 *     @type string             $menu_class      CSS class to use for the ul element which forms the menu. Default 'menu'.
    2626 *     @type string             $menu_id         The ID that is applied to the ul element which forms the menu.
  • trunk/src/wp-includes/nav-menu.php

    r40942 r40969  
    1313 * @since 3.0.0
    1414 *
    15  * @param int|string|WP_Term $menu Menu ID, slug, or name - or the menu object.
     15 * @param int|string|WP_Term $menu Menu ID, slug, name, or object.
    1616 * @return WP_Term|false False if $menu param isn't supplied or term does not exist, menu object if successful.
    1717 */
     
    4444     * @since 4.3.0
    4545     *
    46      * @param object|false $menu_obj Term from nav_menu taxonomy, or false if nothing had been found.
    47      * @param string       $menu     The menu ID, slug, or name passed to wp_get_nav_menu_object().
     46     * @param WP_Term|false      $menu_obj Term from nav_menu taxonomy, or false if nothing had been found.
     47     * @param int|string|WP_Term $menu     The menu ID, slug, name, or object passed to wp_get_nav_menu_object().
    4848     */
    4949    return apply_filters( 'wp_get_nav_menu_object', $menu_obj, $menu );
     
    5757 * @since 3.0.0
    5858 *
    59  * @param int|string $menu The menu to check (ID, slug, or name).
     59 * @param int|string|WP_Term $menu Menu ID, slug, name, or object of menu to check.
    6060 * @return bool Whether the menu exists.
    6161 */
     
    217217 * @since 3.0.0
    218218 *
    219  * @param string $menu Menu ID, slug, or name.
     219 * @param int|string|WP_Term $menu Menu ID, slug, name, or object.
    220220 * @return bool|WP_Error True on success, false or WP_Error object on failure.
    221221 */
     
    587587 * @staticvar array $fetched
    588588 *
    589  * @param string $menu Menu name, ID, or slug.
    590  * @param array  $args {
     589 * @param int|string|WP_Term $menu Menu ID, slug, name, or object.
     590 * @param array              $args {
    591591 *     Optional. Arguments to pass to get_posts().
    592592 *
Note: See TracChangeset for help on using the changeset viewer.