Changeset 29665
- Timestamp:
- 09/02/2014 06:49:11 AM (10 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/plugin.php
r29472 r29665 106 106 */ 107 107 function has_filter($tag, $function_to_check = false) { 108 // Don't reset the internal array pointer 108 109 $wp_filter = $GLOBALS['wp_filter']; 109 110 -
trunk/tests/phpunit/tests/filters.php
r29422 r29665 294 294 $this->assertFalse( has_filter( $tag ) ); 295 295 } 296 297 /** 298 * @ticket 29070 299 */ 300 function test_has_filter_doesnt_reset_wp_filter() { 301 add_action( 'action_test_has_filter_doesnt_reset_wp_filter', '__return_null', 1 ); 302 add_action( 'action_test_has_filter_doesnt_reset_wp_filter', '__return_null', 2 ); 303 add_action( 'action_test_has_filter_doesnt_reset_wp_filter', '__return_null', 3 ); 304 add_action( 'action_test_has_filter_doesnt_reset_wp_filter', array( $this, '_action_test_has_filter_doesnt_reset_wp_filter' ), 4 ); 305 306 do_action( 'action_test_has_filter_doesnt_reset_wp_filter' ); 307 } 308 function _action_test_has_filter_doesnt_reset_wp_filter() { 309 global $wp_filter; 310 311 has_action( 'action_test_has_filter_doesnt_reset_wp_filter', '_function_that_doesnt_exist' ); 312 313 $filters = current( $wp_filter['action_test_has_filter_doesnt_reset_wp_filter'] ); 314 $the_ = current( $filters ); 315 $this->assertEquals( $the_['function'], array( $this, '_action_test_has_filter_doesnt_reset_wp_filter' ) ); 316 } 296 317 }
Note: See TracChangeset
for help on using the changeset viewer.