From 0c1f92e30120383e09bf5478260b4c1b04426918 Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Thu, 24 Sep 2015 03:17:24 +0000 Subject: [PATCH] Nav Menus: Add a 'nav_menu_item_args' filter to `Walker_Nav_Menu::start_el()`. Props bjornjohansen. Fixes #29417. Built from https://develop.svn.wordpress.org/trunk@34471 git-svn-id: http://core.svn.wordpress.org/trunk@34435 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/nav-menu-template.php | 9 +++++++++ wp-includes/version.php | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/wp-includes/nav-menu-template.php b/wp-includes/nav-menu-template.php index f23f6b9e90..58e557e92d 100644 --- a/wp-includes/nav-menu-template.php +++ b/wp-includes/nav-menu-template.php @@ -71,6 +71,7 @@ class Walker_Nav_Menu extends Walker { * @see Walker::start_el() * * @since 3.0.0 + * @since 4.4.0 'nav_menu_item_args' filter was added. * * @param string $output Passed by reference. Used to append additional content. * @param object $item Menu item data object. @@ -84,6 +85,14 @@ class Walker_Nav_Menu extends Walker { $classes = empty( $item->classes ) ? array() : (array) $item->classes; $classes[] = 'menu-item-' . $item->ID; + /** + * @since 4.4.0 + * + * @param array $args An array of arguments. + * @param object $item Menu item data object. + */ + $args = apply_filters( 'nav_menu_item_args', $args, $item ); + /** * Filter the CSS class(es) applied to a menu item's list item element. * diff --git a/wp-includes/version.php b/wp-includes/version.php index a88a564b1e..5d7e35bc90 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.4-alpha-34470'; +$wp_version = '4.4-alpha-34471'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.