Skip to content

Commit

Permalink
Phpcs Update
Browse files Browse the repository at this point in the history
  • Loading branch information
karthick-murugan committed Nov 12, 2024
1 parent 9e4ec73 commit b257a9c
Showing 1 changed file with 17 additions and 15 deletions.
32 changes: 17 additions & 15 deletions lib/compat/wordpress-6.7/rest-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit b257a9c

Please sign in to comment.