Changeset 31014
- Timestamp:
- 12/31/2014 07:06:29 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/plugin.php
r30544 r31014 326 326 327 327 if ( isset( $wp_filter[ $tag ]) ) { 328 if ( false !== $priority && isset( $wp_filter[ $tag ][ $priority ] ) ) { 328 if ( false === $priority ) { 329 $wp_filter[ $tag ] = array(); 330 } else if ( isset( $wp_filter[ $tag ][ $priority ] ) ) { 329 331 $wp_filter[ $tag ][ $priority ] = array(); 330 } else {331 $wp_filter[ $tag ] = array();332 332 } 333 333 } -
trunk/tests/phpunit/tests/filters.php
r30519 r31014 198 198 199 199 /** 200 * @ticket 20920 201 */ 202 function test_remove_all_filters_should_respect_the_priority_argument() { 203 $a = new MockAction(); 204 $tag = rand_str(); 205 $val = rand_str(); 206 207 add_filter( $tag, array( $a, 'filter' ), 12 ); 208 $this->assertTrue( has_filter( $tag ) ); 209 210 // Should not be removed. 211 remove_all_filters( $tag, 11 ); 212 $this->assertTrue( has_filter( $tag ) ); 213 214 remove_all_filters( $tag, 12 ); 215 $this->assertFalse( has_filter( $tag ) ); 216 } 217 218 /** 200 219 * @ticket 9886 201 220 */
Note: See TracChangeset
for help on using the changeset viewer.