Remove unnecessary code.

This commit is contained in:
Vedanshu Jain 2024-09-19 15:32:43 +05:30
parent 3cb4c3a683
commit 84b596af14
1 changed files with 10 additions and 15 deletions

View File

@ -106,24 +106,19 @@ class HooksRegistry {
* DANGEROUS: This method is used for testing and benchmarking. Do not call, unless you really know what you are doing.
*/
public static function unload_hooks() {
if ( is_admin() ) {
foreach ( self::$admin_actions as $action ) {
call_user_func_array( 'remove_action', $action );
}
foreach ( self::$admin_filters as $filter ) {
call_user_func_array( 'remove_filter', $filter );
}
foreach ( self::$admin_actions as $action ) {
call_user_func_array( 'remove_action', $action );
}
if ( ! is_admin() && ! defined( 'DOING_CRON' ) ) {
foreach ( self::$frontend_actions as $action ) {
call_user_func_array( 'remove_action', $action );
}
foreach ( self::$admin_filters as $filter ) {
call_user_func_array( 'remove_filter', $filter );
}
foreach ( self::$frontend_actions as $action ) {
call_user_func_array( 'remove_action', $action );
}
foreach ( self::$frontend_filters as $filter ) {
call_user_func_array( 'remove_filter', $filter );
}
foreach ( self::$frontend_filters as $filter ) {
call_user_func_array( 'remove_filter', $filter );
}
foreach ( self::$all_request_actions as $action ) {