Changeset 38571 for trunk/tests/phpunit/includes/testcase.php
- Timestamp:
- 09/08/2016 03:54:13 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/includes/testcase.php
r38405 r38571 224 224 */ 225 225 protected function _backup_hooks() { 226 $globals = array( ' merged_filters', 'wp_actions', 'wp_current_filter', 'wp_filter' );226 $globals = array( 'wp_actions', 'wp_current_filter' ); 227 227 foreach ( $globals as $key ) { 228 228 self::$hooks_saved[ $key ] = $GLOBALS[ $key ]; 229 } 230 self::$hooks_saved['wp_filter'] = array(); 231 foreach ( $GLOBALS['wp_filter'] as $hook_name => $hook_object ) { 232 self::$hooks_saved['wp_filter'][ $hook_name ] = clone $hook_object; 229 233 } 230 234 } … … 241 245 */ 242 246 protected function _restore_hooks() { 243 $globals = array( ' merged_filters', 'wp_actions', 'wp_current_filter', 'wp_filter' );247 $globals = array( 'wp_actions', 'wp_current_filter' ); 244 248 foreach ( $globals as $key ) { 245 249 if ( isset( self::$hooks_saved[ $key ] ) ) { 246 250 $GLOBALS[ $key ] = self::$hooks_saved[ $key ]; 251 } 252 } 253 if ( isset( self::$hooks_saved['wp_filter'] ) ) { 254 $GLOBALS['wp_filter'] = array(); 255 foreach ( self::$hooks_saved['wp_filter'] as $hook_name => $hook_object ) { 256 $GLOBALS['wp_filter'][ $hook_name ] = clone $hook_object; 247 257 } 248 258 }
Note: See TracChangeset
for help on using the changeset viewer.