You appear to be a bot. Output may be restricted
Description
Saves the action and filter-related globals so they can be restored later.Stores $merged_filters, $wp_actions, $wp_current_filter, and $wp_filter on a class variable so they can be restored on tearDown() using _restore_hooks().
Usage
$void = WP_UnitTestCase::_backup_hooks();
Parameters
Returns
voidSource
File name: oik-batch/tests/testcase.phpLines:
1 to 10 of 10
protected function _backup_hooks() { $globals = array( 'wp_actions', 'wp_current_filter' ); foreach ( $globals as $key ) { self::$hooks_saved[ $key ] = $GLOBALS[ $key ]; } self::$hooks_saved['wp_filter'] = array(); foreach ( $GLOBALS['wp_filter'] as $hook_name => $hook_object ) { self::$hooks_saved['wp_filter'][ $hook_name ] = clone $hook_object; } }View on GitHub