Fixes for hooks documentation wp-includes/nav-menu-template.php.
See #26869, #25229 and [25410]. Built from https://develop.svn.wordpress.org/trunk@27201 git-svn-id: http://core.svn.wordpress.org/trunk@27058 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
2e07a4e45f
commit
17248058f3
|
@ -92,9 +92,11 @@ class Walker_Nav_Menu extends Walker {
|
|||
*
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @see wp_nav_menu()
|
||||
*
|
||||
* @param array $classes The CSS classes that are applied to the menu item's <li>.
|
||||
* @param object $item The current menu item.
|
||||
* @param array $args An array of arguments. @see wp_nav_menu()
|
||||
* @param array $args An array of wp_nav_menu() arguments.
|
||||
*/
|
||||
$class_names = join( ' ', apply_filters( 'nav_menu_css_class', array_filter( $classes ), $item, $args ) );
|
||||
$class_names = $class_names ? ' class="' . esc_attr( $class_names ) . '"' : '';
|
||||
|
@ -104,9 +106,11 @@ class Walker_Nav_Menu extends Walker {
|
|||
*
|
||||
* @since 3.0.1
|
||||
*
|
||||
* @param string The ID that is applied to the menu item's <li>.
|
||||
* @see wp_nav_menu()
|
||||
*
|
||||
* @param string $menu_id The ID that is applied to the menu item's <li>.
|
||||
* @param object $item The current menu item.
|
||||
* @param array $args An array of arguments. @see wp_nav_menu()
|
||||
* @param array $args An array of wp_nav_menu() arguments.
|
||||
*/
|
||||
$id = apply_filters( 'nav_menu_item_id', 'menu-item-'. $item->ID, $item, $args );
|
||||
$id = $id ? ' id="' . esc_attr( $id ) . '"' : '';
|
||||
|
@ -124,16 +128,18 @@ class Walker_Nav_Menu extends Walker {
|
|||
*
|
||||
* @since 3.6.0
|
||||
*
|
||||
* @see wp_nav_menu()
|
||||
*
|
||||
* @param array $atts {
|
||||
* The HTML attributes applied to the menu item's <a>, empty strings are ignored.
|
||||
*
|
||||
* @type string $title The title attribute.
|
||||
* @type string $target The target attribute.
|
||||
* @type string $title Title attribute.
|
||||
* @type string $target Target attribute.
|
||||
* @type string $rel The rel attribute.
|
||||
* @type string $href The href attribute.
|
||||
* }
|
||||
* @param object $item The current menu item.
|
||||
* @param array $args An array of arguments. @see wp_nav_menu()
|
||||
* @param array $args An array of wp_nav_menu() arguments.
|
||||
*/
|
||||
$atts = apply_filters( 'nav_menu_link_attributes', $atts, $item, $args );
|
||||
|
||||
|
@ -161,10 +167,12 @@ class Walker_Nav_Menu extends Walker {
|
|||
*
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @see wp_nav_menu()
|
||||
*
|
||||
* @param string $item_output The menu item's starting HTML output.
|
||||
* @param object $item Menu item data object.
|
||||
* @param int $depth Depth of menu item. Used for padding.
|
||||
* @param array $args An array of arguments. @see wp_nav_menu()
|
||||
* @param array $args An array of wp_nav_menu() arguments.
|
||||
*/
|
||||
$output .= apply_filters( 'walker_nav_menu_start_el', $item_output, $item, $depth, $args );
|
||||
}
|
||||
|
@ -226,7 +234,9 @@ function wp_nav_menu( $args = array() ) {
|
|||
*
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param array $args Arguments from {@see wp_nav_menu()}.
|
||||
* @see wp_nav_menu()
|
||||
*
|
||||
* @param array $args Array of wp_nav_menu() arguments.
|
||||
*/
|
||||
$args = apply_filters( 'wp_nav_menu_args', $args );
|
||||
$args = (object) $args;
|
||||
|
@ -277,7 +287,8 @@ function wp_nav_menu( $args = array() ) {
|
|||
*
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param array The acceptable HTML tags for use as menu containers, defaults as 'div' and 'nav'.
|
||||
* @param array $tags The acceptable HTML tags for use as menu containers.
|
||||
* Default is array containing 'div' and 'nav'.
|
||||
*/
|
||||
$allowed_tags = apply_filters( 'wp_nav_menu_container_allowedtags', array( 'div', 'nav' ) );
|
||||
if ( in_array( $args->container, $allowed_tags ) ) {
|
||||
|
@ -341,8 +352,10 @@ function wp_nav_menu( $args = array() ) {
|
|||
*
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @see wp_nav_menu()
|
||||
*
|
||||
* @param string $items The HTML list content for the menu items.
|
||||
* @param array $args Arguments from {@see wp_nav_menu()}.
|
||||
* @param array $args Array of wp_nav_menu() arguments.
|
||||
*/
|
||||
$items = apply_filters( 'wp_nav_menu_items', $items, $args );
|
||||
/**
|
||||
|
@ -350,8 +363,10 @@ function wp_nav_menu( $args = array() ) {
|
|||
*
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @see wp_nav_menu()
|
||||
*
|
||||
* @param string $items The HTML list content for the menu items.
|
||||
* @param array $args Arguments from {@see wp_nav_menu()}.
|
||||
* @param array $args Array of wp_nav_menu() arguments.
|
||||
*/
|
||||
$items = apply_filters( "wp_nav_menu_{$menu->slug}_items", $items, $args );
|
||||
|
||||
|
@ -370,8 +385,10 @@ function wp_nav_menu( $args = array() ) {
|
|||
*
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @see wp_nav_menu()
|
||||
*
|
||||
* @param string $nav_menu The HTML content for the navigation menu.
|
||||
* @param array $args Arguments from {@see wp_nav_menu()}.
|
||||
* @param array $args Array of wp_nav_menu() arguments.
|
||||
*/
|
||||
$nav_menu = apply_filters( 'wp_nav_menu', $nav_menu, $args );
|
||||
|
||||
|
|
Loading…
Reference in New Issue