WordPress.org

Make WordPress Core

Ticket #34226: the_widget_filter.patch

File the_widget_filter.patch, 985 bytes (added by MarcGuay, 5 years ago)
  • 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 28daba1..a91393c 100644
    a b function the_widget( $widget, $instance = array(), $args = array() ) { 
    16251625
    16261626        $args = wp_parse_args($args, $default_args);
    16271627        $instance = wp_parse_args($instance);
    1628 
     1628       
     1629        /**
     1630         * Filter the settings for a particular widget instance.
     1631         *
     1632         * Returning false will effectively short-circuit display of the widget.
     1633         *
     1634         * @since 2.8.0
     1635         *
     1636         * @param array     $instance The current widget instance's settings.
     1637         * @param WP_Widget $this     The current widget instance.
     1638         * @param array     $args     An array of default widget arguments.
     1639         */
     1640        $instance = apply_filters( 'widget_display_callback', $instance, $widget_obj, $args );
     1641       
     1642        if ( false === $instance ) {
     1643                return;
     1644        }
     1645       
    16291646        /**
    16301647         * Fires before rendering the requested widget.
    16311648         *