`WP_Widget_Links`: pass widget instance to `widget_links_args` filter

Props SergeyBiryukov, MikeHansenMe, DrewAPicture.
Fixes #20788.

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


git-svn-id: http://core.svn.wordpress.org/trunk@33940 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Scott Taylor 2015-09-09 04:42:24 +00:00
parent 02ae926dfd
commit 4bdda75696
2 changed files with 21 additions and 11 deletions

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.4-alpha-33970';
$wp_version = '4.4-alpha-33971';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.

View File

@ -29,24 +29,34 @@ class WP_Widget_Links extends WP_Widget {
$before_widget = preg_replace( '/id="[^"]*"/', 'id="%id"', $args['before_widget'] );
$widget_links_args = array(
'title_before' => $args['before_title'],
'title_after' => $args['after_title'],
'category_before' => $before_widget,
'category_after' => $args['after_widget'],
'show_images' => $show_images,
'show_description' => $show_description,
'show_name' => $show_name,
'show_rating' => $show_rating,
'category' => $category,
'class' => 'linkcat widget',
'orderby' => $orderby,
'order' => $order,
'limit' => $limit,
);
/**
* Filter the arguments for the Links widget.
*
* @since 2.6.0
* @since 4.4.0 The `$instance` parameter was added.
*
* @see wp_list_bookmarks()
*
* @param array $args An array of arguments to retrieve the links list.
* @param array $args An array of arguments to retrieve the links list.
* @param array $instance The settings for the particular instance of the widget.
*/
wp_list_bookmarks( apply_filters( 'widget_links_args', array(
'title_before' => $args['before_title'], 'title_after' => $args['after_title'],
'category_before' => $before_widget, 'category_after' => $args['after_widget'],
'show_images' => $show_images, 'show_description' => $show_description,
'show_name' => $show_name, 'show_rating' => $show_rating,
'category' => $category, 'class' => 'linkcat widget',
'orderby' => $orderby, 'order' => $order,
'limit' => $limit,
) ) );
wp_list_bookmarks( apply_filters( 'widget_links_args', $widget_links_args, $instance ) );
}
/**