From b257a9c441e6b84c535b026c646c24ee91870b2d Mon Sep 17 00:00:00 2001 From: karthick-murugan Date: Tue, 12 Nov 2024 16:09:05 +0530 Subject: [PATCH] Phpcs Update --- lib/compat/wordpress-6.7/rest-api.php | 32 ++++++++++++++------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/lib/compat/wordpress-6.7/rest-api.php b/lib/compat/wordpress-6.7/rest-api.php index fec8e2474f3558..22d93db7386fee 100644 --- a/lib/compat/wordpress-6.7/rest-api.php +++ b/lib/compat/wordpress-6.7/rest-api.php @@ -157,21 +157,23 @@ function gutenberg_register_post_type_args_for_wp_global_styles( $args, $post_ty add_filter( 'register_post_type_args', 'gutenberg_register_post_type_args_for_wp_global_styles', 10, 2 ); -/** - * Registers the custom REST API route for deactivating all plugins. - */ -function register_deactivate_plugins_endpoint() { - register_rest_route( - 'custom/v1', - '/deactivate-plugins', - array( - 'methods' => 'POST', - 'callback' => 'deactivate_all_plugins', - 'permission_callback' => function () { - return current_user_can( 'manage_options' ); - }, - ) - ); +if ( ! function_exists( 'register_deactivate_plugins_endpoint' ) ) { + /** + * Registers the custom REST API route for deactivating all plugins. + */ + function register_deactivate_plugins_endpoint() { + register_rest_route( + 'custom/v1', + '/deactivate-plugins', + array( + 'methods' => 'POST', + 'callback' => 'deactivate_all_plugins', + 'permission_callback' => function () { + return current_user_can( 'manage_options' ); + }, + ) + ); + } } // Hook to register the custom REST API endpoint.