Make WordPress Core


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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.