Make WordPress Core

Changeset 55962


Ignore:
Timestamp:
06/21/2023 08:16:34 AM (19 months ago)
Author:
audrasjb
Message:

Docs: Add missing param description to update_menu_item_cache in wp_get_nav_menu_items().

Because update_menu_item_cache parameter doesn't have any description in this function, the wp_get_nav_menu_items() documentation page on DevHub fallbacks
to get_post() params descriptions… which fallbacks to parse_query().

In parse_query(), the update_menu_item_cache param is set to false by default, so wp_get_nav_menu_items() ends up with a value of false by default,
which is wrong since wp_get_nav_menu_items() overrides this parameter to set it to true by default.

This changeset adds update_menu_item_cache parameter to wp_get_nav_menu_items() docblock, and indicates that it is set to true by default.

Follow-up to [53504].

Props audrasjb, matmoe.
Fixes #58468.
See #57840.

File:
1 edited

Legend:

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

    r55868 r55962  
    675675 *     Optional. Arguments to pass to get_posts().
    676676 *
    677  *     @type string $order       How to order nav menu items as queried with get_posts(). Will be ignored
    678  *                               if 'output' is ARRAY_A. Default 'ASC'.
    679  *     @type string $orderby     Field to order menu items by as retrieved from get_posts(). Supply an orderby
    680  *                               field via 'output_key' to affect the output order of nav menu items.
    681  *                               Default 'menu_order'.
    682  *     @type string $post_type   Menu items post type. Default 'nav_menu_item'.
    683  *     @type string $post_status Menu items post status. Default 'publish'.
    684  *     @type string $output      How to order outputted menu items. Default ARRAY_A.
    685  *     @type string $output_key  Key to use for ordering the actual menu items that get returned. Note that
    686  *                               that is not a get_posts() argument and will only affect output of menu items
    687  *                               processed in this function. Default 'menu_order'.
    688  *     @type bool   $nopaging    Whether to retrieve all menu items (true) or paginate (false). Default true.
     677 *     @type string $order                  How to order nav menu items as queried with get_posts().
     678 *                                          Will be ignored if 'output' is ARRAY_A. Default 'ASC'.
     679 *     @type string $orderby                Field to order menu items by as retrieved from get_posts().
     680 *                                          Supply an orderby field via 'output_key' to affect the
     681 *                                          output order of nav menu items. Default 'menu_order'.
     682 *     @type string $post_type              Menu items post type. Default 'nav_menu_item'.
     683 *     @type string $post_status            Menu items post status. Default 'publish'.
     684 *     @type string $output                 How to order outputted menu items. Default ARRAY_A.
     685 *     @type string $output_key             Key to use for ordering the actual menu items that get
     686 *                                          returned. Note that that is not a get_posts() argument
     687 *                                          and will only affect output of menu items processed in
     688 *                                          this function. Default 'menu_order'.
     689 *     @type bool   $nopaging               Whether to retrieve all menu items (true) or paginate
     690 *                                          (false). Default true.
     691 *     @type bool   $update_menu_item_cache Whether to update the menu item cache. Default true.
    689692 * }
    690693 * @return array|false Array of menu items, otherwise false.
Note: See TracChangeset for help on using the changeset viewer.