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. Built from https://develop.svn.wordpress.org/trunk@40969 git-svn-id: http://core.svn.wordpress.org/trunk@40819 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
7001a3cce6
commit
36759db92e
|
@ -21,7 +21,7 @@ require_once ABSPATH . WPINC . '/class-walker-nav-menu.php';
|
||||||
* @param array $args {
|
* @param array $args {
|
||||||
* Optional. Array of nav menu arguments.
|
* Optional. Array of nav menu arguments.
|
||||||
*
|
*
|
||||||
* @type int|string|WP_Term $menu Desired menu. Accepts (matching in order) id, slug, name, menu object. Default empty.
|
* @type int|string|WP_Term $menu Desired menu. Accepts a menu ID, slug, name, or object. Default empty.
|
||||||
* @type string $menu_class CSS class to use for the ul element which forms the menu. Default 'menu'.
|
* @type string $menu_class CSS class to use for the ul element which forms the menu. Default 'menu'.
|
||||||
* @type string $menu_id The ID that is applied to the ul element which forms the menu.
|
* @type string $menu_id The ID that is applied to the ul element which forms the menu.
|
||||||
* Default is the menu slug, incremented.
|
* Default is the menu slug, incremented.
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
*
|
*
|
||||||
* @since 3.0.0
|
* @since 3.0.0
|
||||||
*
|
*
|
||||||
* @param int|string|WP_Term $menu Menu ID, slug, or name - or the menu object.
|
* @param int|string|WP_Term $menu Menu ID, slug, name, or object.
|
||||||
* @return WP_Term|false False if $menu param isn't supplied or term does not exist, menu object if successful.
|
* @return WP_Term|false False if $menu param isn't supplied or term does not exist, menu object if successful.
|
||||||
*/
|
*/
|
||||||
function wp_get_nav_menu_object( $menu ) {
|
function wp_get_nav_menu_object( $menu ) {
|
||||||
|
@ -43,8 +43,8 @@ function wp_get_nav_menu_object( $menu ) {
|
||||||
*
|
*
|
||||||
* @since 4.3.0
|
* @since 4.3.0
|
||||||
*
|
*
|
||||||
* @param object|false $menu_obj Term from nav_menu taxonomy, or false if nothing had been found.
|
* @param WP_Term|false $menu_obj Term from nav_menu taxonomy, or false if nothing had been found.
|
||||||
* @param string $menu The menu ID, slug, or name passed to wp_get_nav_menu_object().
|
* @param int|string|WP_Term $menu The menu ID, slug, name, or object passed to wp_get_nav_menu_object().
|
||||||
*/
|
*/
|
||||||
return apply_filters( 'wp_get_nav_menu_object', $menu_obj, $menu );
|
return apply_filters( 'wp_get_nav_menu_object', $menu_obj, $menu );
|
||||||
}
|
}
|
||||||
|
@ -56,7 +56,7 @@ function wp_get_nav_menu_object( $menu ) {
|
||||||
*
|
*
|
||||||
* @since 3.0.0
|
* @since 3.0.0
|
||||||
*
|
*
|
||||||
* @param int|string $menu The menu to check (ID, slug, or name).
|
* @param int|string|WP_Term $menu Menu ID, slug, name, or object of menu to check.
|
||||||
* @return bool Whether the menu exists.
|
* @return bool Whether the menu exists.
|
||||||
*/
|
*/
|
||||||
function is_nav_menu( $menu ) {
|
function is_nav_menu( $menu ) {
|
||||||
|
@ -216,7 +216,7 @@ function wp_create_nav_menu( $menu_name ) {
|
||||||
*
|
*
|
||||||
* @since 3.0.0
|
* @since 3.0.0
|
||||||
*
|
*
|
||||||
* @param string $menu Menu ID, slug, or name.
|
* @param int|string|WP_Term $menu Menu ID, slug, name, or object.
|
||||||
* @return bool|WP_Error True on success, false or WP_Error object on failure.
|
* @return bool|WP_Error True on success, false or WP_Error object on failure.
|
||||||
*/
|
*/
|
||||||
function wp_delete_nav_menu( $menu ) {
|
function wp_delete_nav_menu( $menu ) {
|
||||||
|
@ -586,7 +586,7 @@ function _is_valid_nav_menu_item( $item ) {
|
||||||
* @global string $_menu_item_sort_prop
|
* @global string $_menu_item_sort_prop
|
||||||
* @staticvar array $fetched
|
* @staticvar array $fetched
|
||||||
*
|
*
|
||||||
* @param string $menu Menu name, ID, or slug.
|
* @param int|string|WP_Term $menu Menu ID, slug, name, or object.
|
||||||
* @param array $args {
|
* @param array $args {
|
||||||
* Optional. Arguments to pass to get_posts().
|
* Optional. Arguments to pass to get_posts().
|
||||||
*
|
*
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '4.9-alpha-40968';
|
$wp_version = '4.9-alpha-40969';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
|
Loading…
Reference in New Issue