Menus: Improve documentation of new `$item_spacing` argument.

Adds `@since` tags for and improves description of the new `$item_spacing` argument added to `wp_nav_menu()`, `wp_list_pages()`, and `wp_page_menu()` in [38523].

Props johnbillion for copy.
See #35206.

Built from https://develop.svn.wordpress.org/trunk@38574


git-svn-id: http://core.svn.wordpress.org/trunk@38517 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Peter Wilson 2016-09-08 05:32:03 +00:00
parent f5db425059
commit 6cdab630cd
3 changed files with 7 additions and 4 deletions

View File

@ -14,6 +14,7 @@ require_once ABSPATH . WPINC . '/class-walker-nav-menu.php';
* Displays a navigation menu. * Displays a navigation menu.
* *
* @since 3.0.0 * @since 3.0.0
* @since 4.7.0 Added the `item_spacing` argument.
* *
* @staticvar array $menu_id_slugs * @staticvar array $menu_id_slugs
* *
@ -40,7 +41,7 @@ require_once ABSPATH . WPINC . '/class-walker-nav-menu.php';
* in order to be selectable by the user. * in order to be selectable by the user.
* @type string $items_wrap How the list items should be wrapped. Default is a ul with an id and class. * @type string $items_wrap How the list items should be wrapped. Default is a ul with an id and class.
* Uses printf() format with numbered placeholders. * Uses printf() format with numbered placeholders.
* @type string $item_spacing Whether whitespace format the menu's HTML: 'discard' or 'preserve' (default). * @type string $item_spacing Whether to preserve whitespace within the menu's HTML. Accepts 'preserve' or 'discard'. Default 'preserve'.
* } * }
* @return object|false|void Menu output if $echo is false, false if there are no items or no menu was found. * @return object|false|void Menu output if $echo is false, false if there are no items or no menu was found.
*/ */

View File

@ -1109,6 +1109,7 @@ function wp_dropdown_pages( $args = '' ) {
* Retrieve or display list of pages in list (li) format. * Retrieve or display list of pages in list (li) format.
* *
* @since 1.5.0 * @since 1.5.0
* @since 4.7.0 Added the `item_spacing` argument.
* *
* @see get_pages() * @see get_pages()
* *
@ -1138,7 +1139,7 @@ function wp_dropdown_pages( $args = '' ) {
* 'menu_order', 'post_parent', 'ID', 'rand', or 'comment_count'. Default 'post_title'. * 'menu_order', 'post_parent', 'ID', 'rand', or 'comment_count'. Default 'post_title'.
* @type string $title_li List heading. Passing a null or empty value will result in no heading, and the list * @type string $title_li List heading. Passing a null or empty value will result in no heading, and the list
* will not be wrapped with unordered list `<ul>` tags. Default 'Pages'. * will not be wrapped with unordered list `<ul>` tags. Default 'Pages'.
* @type string $item_spacing Whether whitespace format the menu's HTML: 'discard' or 'preserve' (default). * @type string $item_spacing Whether to preserve whitespace within the menu's HTML. Accepts 'preserve' or 'discard'. Default 'preserve'.
* @type Walker $walker Walker instance to use for listing pages. Default empty (Walker_Page). * @type Walker $walker Walker instance to use for listing pages. Default empty (Walker_Page).
* } * }
* @return string|void HTML list of pages. * @return string|void HTML list of pages.
@ -1232,6 +1233,7 @@ function wp_list_pages( $args = '' ) {
* *
* @since 2.7.0 * @since 2.7.0
* @since 4.4.0 Added `menu_id`, `container`, `before`, `after`, and `walker` arguments. * @since 4.4.0 Added `menu_id`, `container`, `before`, `after`, and `walker` arguments.
* @since 4.7.0 Added the `item_spacing` argument.
* *
* @param array|string $args { * @param array|string $args {
* Optional. Arguments to generate a page menu. See wp_list_pages() for additional arguments. * Optional. Arguments to generate a page menu. See wp_list_pages() for additional arguments.
@ -1249,7 +1251,7 @@ function wp_list_pages( $args = '' ) {
* @type string $link_after The HTML or text to append to $show_home text. Default empty. * @type string $link_after The HTML or text to append to $show_home text. Default empty.
* @type string $before The HTML or text to prepend to the menu. Default is '<ul>'. * @type string $before The HTML or text to prepend to the menu. Default is '<ul>'.
* @type string $after The HTML or text to append to the menu. Default is '</ul>'. * @type string $after The HTML or text to append to the menu. Default is '</ul>'.
* @type string $item_spacing Whether whitespace format the menu's HTML: 'discard' or 'preserve' (default). * @type string $item_spacing Whether to preserve whitespace within the menu's HTML. Accepts 'preserve' or 'discard'. Default 'discard'.
* @type Walker $walker Walker instance to use for listing pages. Default empty (Walker_Page). * @type Walker $walker Walker instance to use for listing pages. Default empty (Walker_Page).
* } * }
* @return string|void HTML menu * @return string|void HTML menu

View File

@ -4,7 +4,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '4.7-alpha-38573'; $wp_version = '4.7-alpha-38574';
/** /**
* 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.