WordPress.org

Make WordPress Core


Ignore:
Timestamp:
10/02/2017 10:01:19 PM (3 years ago)
Author:
SergeyBiryukov
Message:

Widgets: Pass $instance to widget argument filters:

  • widget_archives_dropdown_args
  • widget_archives_args
  • widget_categories_dropdown_args
  • widget_categories_args
  • widget_meta_poweredby
  • widget_pages_args
  • widget_comments_args
  • widget_posts_args
  • widget_tag_cloud_args

See [33971] for widget_links_args and [34662] for widget_nav_menu_args.

Props Takahashi_Fumiki.
Fixes #38017.

File:
1 edited

Legend:

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

    r41162 r41685  
    6262             *
    6363             * @since 2.8.0
     64             * @since 4.9.0 Added the `$instance` parameter.
    6465             *
    6566             * @see wp_get_archives()
    6667             *
    67              * @param array $args An array of Archives widget drop-down arguments.
     68             * @param array $args     An array of Archives widget drop-down arguments.
     69             * @param array $instance Settings for the current Archives widget instance.
    6870             */
    6971            $dropdown_args = apply_filters( 'widget_archives_dropdown_args', array(
     
    7173                'format'          => 'option',
    7274                'show_post_count' => $c
    73             ) );
     75            ), $instance );
    7476
    7577            switch ( $dropdown_args['type'] ) {
     
    103105         *
    104106         * @since 2.8.0
     107         * @since 4.9.0 Added the `$instance` parameter.
    105108         *
    106109         * @see wp_get_archives()
    107110         *
    108          * @param array $args An array of Archives option arguments.
     111         * @param array $args     An array of Archives option arguments.
     112         * @param array $instance Array of settings for the current widget.
    109113         */
    110114        wp_get_archives( apply_filters( 'widget_archives_args', array(
    111115            'type'            => 'monthly',
    112116            'show_post_count' => $c
    113         ) ) );
     117        ), $instance ) );
    114118        ?>
    115119        </ul>
Note: See TracChangeset for help on using the changeset viewer.