Changeset 45798
- Timestamp:
- 08/14/2019 11:02:25 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
-
src/wp-includes/widgets.php (modified) (1 diff)
-
tests/phpunit/tests/widgets.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/widgets.php
r45674 r45798 1126 1126 $instance = wp_parse_args( $instance ); 1127 1127 1128 /** This filter is documented in wp-includes/class-wp-widget.php */ 1129 $instance = apply_filters( 'widget_display_callback', $instance, $widget_obj, $args ); 1130 1131 if ( false === $instance ) { 1132 return; 1133 } 1134 1128 1135 /** 1129 1136 * Fires before rendering the requested widget. -
trunk/tests/phpunit/tests/widgets.php
r45607 r45798 714 714 715 715 /** 716 * @ticket 34226 717 */ 718 public function test_the_widget_should_short_circuit_with_widget_display_callback() { 719 add_filter( 'widget_display_callback', '__return_false' ); 720 721 register_widget( 'WP_Widget_Text' ); 722 723 ob_start(); 724 the_widget( 'WP_Widget_Text' ); 725 $widget_content = ob_get_clean(); 726 unregister_widget( 'WP_Widget_Text' ); 727 728 $this->assertEmpty( $widget_content ); 729 } 730 731 /** 716 732 * Register nav menu sidebars. 717 733 *
Note: See TracChangeset
for help on using the changeset viewer.