WordPress.org

Make WordPress Core

Ticket #34226: the_widget_filter-2.patch

File the_widget_filter-2.patch, 958 bytes (added by MarcGuay, 5 years ago)

Patch updated for 4.4 and changed $this to $widget_obj in the docblock.

  • public_html/wp/wp-includes/widgets.php

    diff --git a/public_html/wp/wp-includes/widgets.php b/public_html/wp/wp-includes/widgets.php
    index 5a2f58c..90d001a 100644
    a b function the_widget( $widget, $instance = array(), $args = array() ) { 
    10441044        $instance = wp_parse_args($instance);
    10451045
    10461046        /**
     1047         * Filter the settings for a particular widget instance.
     1048         *
     1049         * Returning false will effectively short-circuit display of the widget.
     1050         *
     1051         * @since 2.8.0
     1052         *
     1053         * @param array     $instance   The current widget instance's settings.
     1054         * @param WP_Widget $widget_obj The current widget instance.
     1055         * @param array     $args       An array of default widget arguments.
     1056         */
     1057        $instance = apply_filters( 'widget_display_callback', $instance, $widget_obj, $args );
     1058       
     1059        if ( false === $instance ) {
     1060                return;
     1061        }
     1062               
     1063        /**
    10471064         * Fires before rendering the requested widget.
    10481065         *
    10491066         * @since 3.0.0