|
@@ 1024-1026 (lines=3) @@
|
| 1021 |
|
*/ |
| 1022 |
|
public static function deactivate_module( $data ) { |
| 1023 |
|
if ( Jetpack::is_module( $data['slug'] ) ) { |
| 1024 |
|
if ( ! Jetpack::is_module_active( $data['slug'] ) ) { |
| 1025 |
|
return new WP_Error( 'already_inactive', esc_html__( 'The requested Jetpack module was already inactive.', 'jetpack' ), array( 'status' => 409 ) ); |
| 1026 |
|
} |
| 1027 |
|
if ( Jetpack::deactivate_module( $data['slug'] ) ) { |
| 1028 |
|
return rest_ensure_response( array( |
| 1029 |
|
'code' => 'success', |
|
@@ 1057-1059 (lines=3) @@
|
| 1054 |
|
return new WP_Error( 'not_found', esc_html__( 'The requested Jetpack module was not found.', 'jetpack' ), array( 'status' => 404 ) ); |
| 1055 |
|
} |
| 1056 |
|
|
| 1057 |
|
if ( ! Jetpack::is_module_active( $data['slug'] ) ) { |
| 1058 |
|
return new WP_Error( 'inactive', esc_html__( 'The requested Jetpack module is inactive.', 'jetpack' ), array( 'status' => 409 ) ); |
| 1059 |
|
} |
| 1060 |
|
|
| 1061 |
|
// Get parameters to update the module. |
| 1062 |
|
$params = $data->get_json_params(); |