You appear to be a bot. Output may be restricted
Description
Restores the hook-related globals to their state at setUp() so that future tests aren't affected by hooks set during this last test.
Usage
$void = WP_UnitTestCase::_restore_hooks();
Parameters
Returns
voidSource
File name: oik-batch/tests/testcase.phpLines:
1 to 14 of 14
protected function _restore_hooks() { $globals = array( 'wp_actions', 'wp_current_filter' ); foreach ( $globals as $key ) { if ( isset( self::$hooks_saved[ $key ] ) ) { $GLOBALS[ $key ] = self::$hooks_saved[ $key ]; } } if ( isset( self::$hooks_saved['wp_filter'] ) ) { $GLOBALS['wp_filter'] = array(); foreach ( self::$hooks_saved['wp_filter'] as $hook_name => $hook_object ) { $GLOBALS['wp_filter'][ $hook_name ] = clone $hook_object; } } }View on GitHub