`WP_Widget_Links`: pass widget instance to `widget_links_args` filter
Props SergeyBiryukov, MikeHansenMe, DrewAPicture. Fixes #20788. git-svn-id: https://develop.svn.wordpress.org/trunk@33971 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
d6e73d47e4
commit
ab9bbfa9ce
|
@ -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 ) );
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue