Fix doc blocks for nav-menu*.php files.

See #32444.


git-svn-id: https://develop.svn.wordpress.org/trunk@32612 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Scott Taylor 2015-05-26 22:09:26 +00:00
parent 85e3befce9
commit a418d57c5a
2 changed files with 43 additions and 19 deletions

View File

@ -195,6 +195,8 @@ class Walker_Nav_Menu extends Walker {
* *
* @since 3.0.0 * @since 3.0.0
* *
* @staticvar array $menu_id_slugs
*
* @param array $args { * @param array $args {
* Optional. Array of nav menu arguments. * Optional. Array of nav menu arguments.
* *
@ -219,7 +221,7 @@ class Walker_Nav_Menu extends Walker {
* @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.
* } * }
* @return mixed 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.
*/ */
function wp_nav_menu( $args = array() ) { function wp_nav_menu( $args = array() ) {
static $menu_id_slugs = array(); static $menu_id_slugs = array();
@ -430,6 +432,9 @@ function wp_nav_menu( $args = array() ) {
* @access private * @access private
* @since 3.0.0 * @since 3.0.0
* *
* @global WP_Query $wp_query
* @global WP_Rewrite $wp_rewrite
*
* @param array $menu_items The current menu item objects to which to add the class property information. * @param array $menu_items The current menu item objects to which to add the class property information.
*/ */
function _wp_menu_item_classes_by_context( &$menu_items ) { function _wp_menu_item_classes_by_context( &$menu_items ) {
@ -651,7 +656,11 @@ function _wp_menu_item_classes_by_context( &$menu_items ) {
* *
* @uses Walker_Nav_Menu to create HTML list content. * @uses Walker_Nav_Menu to create HTML list content.
* @since 3.0.0 * @since 3.0.0
* @see Walker::walk() for parameters and return description. *
* @param array $items
* @param int $depth
* @param object $r
* @return string
*/ */
function walk_nav_menu_tree( $items, $depth, $r ) { function walk_nav_menu_tree( $items, $depth, $r ) {
$walker = ( empty($r->walker) ) ? new Walker_Nav_Menu : $r->walker; $walker = ( empty($r->walker) ) ? new Walker_Nav_Menu : $r->walker;
@ -665,11 +674,17 @@ function walk_nav_menu_tree( $items, $depth, $r ) {
* *
* @since 3.0.1 * @since 3.0.1
* @access private * @access private
*
* @staticvar array $used_ids
* @param string $id
* @param object $item
* @return string
*/ */
function _nav_menu_item_id_use_once( $id, $item ) { function _nav_menu_item_id_use_once( $id, $item ) {
static $_used_ids = array(); static $_used_ids = array();
if ( in_array( $item->ID, $_used_ids ) ) if ( in_array( $item->ID, $_used_ids ) ) {
return ''; return '';
}
$_used_ids[] = $item->ID; $_used_ids[] = $item->ID;
return $id; return $id;
} }

View File

@ -13,7 +13,7 @@
* @since 3.0.0 * @since 3.0.0
* *
* @param string $menu Menu ID, slug, or name. * @param string $menu Menu ID, slug, or name.
* @return mixed false if $menu param isn't supplied or term does not exist, menu object if successful. * @return object|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 ) {
if ( ! $menu ) if ( ! $menu )
@ -65,6 +65,8 @@ function is_nav_menu( $menu ) {
* *
* @since 3.0.0 * @since 3.0.0
* *
* @global array $_wp_registered_nav_menus
*
* @param array $locations Associative array of menu location identifiers (like a slug) and descriptive text. * @param array $locations Associative array of menu location identifiers (like a slug) and descriptive text.
*/ */
function register_nav_menus( $locations = array() ) { function register_nav_menus( $locations = array() ) {
@ -78,6 +80,8 @@ function register_nav_menus( $locations = array() ) {
/** /**
* Unregisters a navigation menu for a theme. * Unregisters a navigation menu for a theme.
* *
* @global array $_wp_registered_nav_menus
*
* @param string $location The menu location identifier. * @param string $location The menu location identifier.
* @return bool True on success, false on failure. * @return bool True on success, false on failure.
*/ */
@ -109,6 +113,9 @@ function register_nav_menu( $location, $description ) {
* Returns an array of all registered navigation menus in a theme * Returns an array of all registered navigation menus in a theme
* *
* @since 3.0.0 * @since 3.0.0
*
* @global array $_wp_registered_nav_menus
*
* @return array * @return array
*/ */
function get_registered_nav_menus() { function get_registered_nav_menus() {
@ -134,6 +141,7 @@ function get_nav_menu_locations() {
* Whether a registered nav menu location has a menu assigned to it. * Whether a registered nav menu location has a menu assigned to it.
* *
* @since 3.0.0 * @since 3.0.0
*
* @param string $location Menu location identifier. * @param string $location Menu location identifier.
* @return bool Whether location has a menu. * @return bool Whether location has a menu.
*/ */
@ -486,6 +494,8 @@ function wp_get_nav_menus( $args = array() ) {
* @since 3.0.0 * @since 3.0.0
* @access private * @access private
* *
* @global string $_menu_item_sort_prop
*
* @param object $a The first object to compare * @param object $a The first object to compare
* @param object $b The second object to compare * @param object $b The second object to compare
* @return int -1, 0, or 1 if $a is considered to be respectively less than, equal to, or greater than $b. * @return int -1, 0, or 1 if $a is considered to be respectively less than, equal to, or greater than $b.
@ -522,10 +532,7 @@ function _sort_nav_menu_items( $a, $b ) {
* @return bool False if invalid, otherwise true. * @return bool False if invalid, otherwise true.
*/ */
function _is_valid_nav_menu_item( $item ) { function _is_valid_nav_menu_item( $item ) {
if ( ! empty( $item->_invalid ) ) return empty( $item->_invalid );
return false;
return true;
} }
/** /**
@ -533,9 +540,12 @@ function _is_valid_nav_menu_item( $item ) {
* *
* @since 3.0.0 * @since 3.0.0
* *
* @global string $_menu_item_sort_prop
* @staticvar array $fetched
*
* @param string $menu Menu name, ID, or slug. * @param string $menu Menu name, ID, or slug.
* @param array $args Optional. Arguments to pass to {@see get_posts()}. * @param array $args Optional. Arguments to pass to {@see get_posts()}.
* @return mixed $items Array of menu items, otherwise false. * @return false|array $items Array of menu items, otherwise false.
*/ */
function wp_get_nav_menu_items( $menu, $args = array() ) { function wp_get_nav_menu_items( $menu, $args = array() ) {
$menu = wp_get_nav_menu_object( $menu ); $menu = wp_get_nav_menu_object( $menu );
@ -869,7 +879,6 @@ function _wp_delete_tax_menu_item( $object_id = 0, $tt_id, $taxonomy ) {
* @param string $new_status The new status of the post object. * @param string $new_status The new status of the post object.
* @param string $old_status The old status of the post object. * @param string $old_status The old status of the post object.
* @param object $post The post object being transitioned from one status to another. * @param object $post The post object being transitioned from one status to another.
* @return void
*/ */
function _wp_auto_add_pages_to_menu( $new_status, $old_status, $post ) { function _wp_auto_add_pages_to_menu( $new_status, $old_status, $post ) {
if ( 'publish' != $new_status || 'publish' == $old_status || 'page' != $post->post_type ) if ( 'publish' != $new_status || 'publish' == $old_status || 'page' != $post->post_type )