mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-01 07:40:07 +00:00
Widgets: Allow for short-circuiting widget output in the_widget() using the widget_display_callback filter, for consistency with output via a registered sidebar.
Props MarcGuay, donmhico. Fixes #34226. git-svn-id: https://develop.svn.wordpress.org/trunk@45798 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -1125,6 +1125,13 @@ function the_widget( $widget, $instance = array(), $args = array() ) {
|
||||
|
||||
$instance = wp_parse_args( $instance );
|
||||
|
||||
/** This filter is documented in wp-includes/class-wp-widget.php */
|
||||
$instance = apply_filters( 'widget_display_callback', $instance, $widget_obj, $args );
|
||||
|
||||
if ( false === $instance ) {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fires before rendering the requested widget.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user