Add `'widget_nav_menu_args'` filter for Custom Menu widget arguments.

props cyman, DrewAPicture.
fixes #29463.
Built from https://develop.svn.wordpress.org/trunk@31325


git-svn-id: http://core.svn.wordpress.org/trunk@31306 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2015-02-03 02:56:23 +00:00
parent 7c97e59ed6
commit 7690d9b1aa
2 changed files with 21 additions and 2 deletions

View File

@ -1344,7 +1344,26 @@ class WP_Widget_Tag_Cloud extends WP_Widget {
if ( !empty($instance['title']) ) if ( !empty($instance['title']) )
echo $args['before_title'] . $instance['title'] . $args['after_title']; echo $args['before_title'] . $instance['title'] . $args['after_title'];
wp_nav_menu( array( 'fallback_cb' => '', 'menu' => $nav_menu ) ); $nav_menu_args = array(
'fallback_cb' => '',
'menu' => $nav_menu
);
/**
* Filter the arguments for the Custom Menu widget.
*
* @since 4.2.0
*
* @param array $nav_menu_args {
* An array of arguments passed to wp_nav_menu() to retrieve a custom menu.
*
* @type callback|bool $fallback_cb Callback to fire if the menu doesn't exist. Default empty.
* @type mixed $menu Menu ID, slug, or name.
* }
* @param stdClass $nav_menu Nav menu object for the current menu.
* @param array $args Display arguments for the current widget.
*/
wp_nav_menu( apply_filters( 'widget_nav_menu_args', $nav_menu_args, $nav_menu, $args ) );
echo $args['after_widget']; echo $args['after_widget'];
} }

View File

@ -4,7 +4,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '4.2-alpha-31324'; $wp_version = '4.2-alpha-31325';
/** /**
* 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.