|
@@ 896-898 (lines=3) @@
|
| 893 |
|
*/ |
| 894 |
|
public static function deactivate_module( $data ) { |
| 895 |
|
if ( Jetpack::is_module( $data['slug'] ) ) { |
| 896 |
|
if ( ! Jetpack::is_module_active( $data['slug'] ) ) { |
| 897 |
|
return new WP_Error( 'already_inactive', esc_html__( 'The requested Jetpack module was already inactive.', 'jetpack' ), array( 'status' => 409 ) ); |
| 898 |
|
} |
| 899 |
|
if ( Jetpack::deactivate_module( $data['slug'] ) ) { |
| 900 |
|
return rest_ensure_response( array( |
| 901 |
|
'code' => 'success', |
|
@@ 929-931 (lines=3) @@
|
| 926 |
|
return new WP_Error( 'not_found', esc_html__( 'The requested Jetpack module was not found.', 'jetpack' ), array( 'status' => 404 ) ); |
| 927 |
|
} |
| 928 |
|
|
| 929 |
|
if ( ! Jetpack::is_module_active( $data['slug'] ) ) { |
| 930 |
|
return new WP_Error( 'inactive', esc_html__( 'The requested Jetpack module is inactive.', 'jetpack' ), array( 'status' => 409 ) ); |
| 931 |
|
} |
| 932 |
|
|
| 933 |
|
// Get parameters to update the module. |
| 934 |
|
$param = $data->get_json_params(); |