Make WordPress Core

Changeset 33971


Ignore:
Timestamp:
09/09/2015 04:41:21 AM (9 years ago)
Author:
wonderboymusic
Message:

WP_Widget_Links: pass widget instance to widget_links_args filter

Props SergeyBiryukov, MikeHansenMe, DrewAPicture.
Fixes #20788.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/widgets/class-wp-widget-links.php

    r33951 r33971  
    3030        $before_widget = preg_replace( '/id="[^"]*"/', 'id="%id"', $args['before_widget'] );
    3131
     32        $widget_links_args = array(
     33            'title_before'     => $args['before_title'],
     34            'title_after'      => $args['after_title'],
     35            'category_before'  => $before_widget,
     36            'category_after'   => $args['after_widget'],
     37            'show_images'      => $show_images,
     38            'show_description' => $show_description,
     39            'show_name'        => $show_name,
     40            'show_rating'      => $show_rating,
     41            'category'         => $category,
     42            'class'            => 'linkcat widget',
     43            'orderby'          => $orderby,
     44            'order'            => $order,
     45            'limit'            => $limit,
     46        );
     47
    3248        /**
    3349         * Filter the arguments for the Links widget.
    3450         *
    3551         * @since 2.6.0
     52         * @since 4.4.0 The `$instance` parameter was added.
    3653         *
    3754         * @see wp_list_bookmarks()
    3855         *
    39          * @param array $args An array of arguments to retrieve the links list.
     56         * @param array $args     An array of arguments to retrieve the links list.
     57         * @param array $instance The settings for the particular instance of the widget.
    4058         */
    41         wp_list_bookmarks( apply_filters( 'widget_links_args', array(
    42             'title_before' => $args['before_title'], 'title_after' => $args['after_title'],
    43             'category_before' => $before_widget, 'category_after' => $args['after_widget'],
    44             'show_images' => $show_images, 'show_description' => $show_description,
    45             'show_name' => $show_name, 'show_rating' => $show_rating,
    46             'category' => $category, 'class' => 'linkcat widget',
    47             'orderby' => $orderby, 'order' => $order,
    48             'limit' => $limit,
    49         ) ) );
     59        wp_list_bookmarks( apply_filters( 'widget_links_args', $widget_links_args, $instance ) );
    5060    }
    5161
Note: See TracChangeset for help on using the changeset viewer.