@@ 122-128 (lines=7) @@ | ||
119 | ); |
|
120 | } |
|
121 | ||
122 | if ( ! Jetpack::is_module_active( $module_slug ) ) { |
|
123 | return new WP_Error( |
|
124 | 'already_inactive', |
|
125 | esc_html__( 'The requested Jetpack module was already inactive.', 'jetpack' ), |
|
126 | array( 'status' => 409 ) |
|
127 | ); |
|
128 | } |
|
129 | ||
130 | if ( Jetpack::deactivate_module( $module_slug ) ) { |
|
131 | return rest_ensure_response( array( |
|
@@ 469-471 (lines=3) @@ | ||
466 | return new WP_Error( 'not_found', esc_html__( 'The requested Jetpack module was not found.', 'jetpack' ), array( 'status' => 404 ) ); |
|
467 | } |
|
468 | ||
469 | if ( ! Jetpack::is_module_active( $request['slug'] ) ) { |
|
470 | return new WP_Error( 'inactive', esc_html__( 'The requested Jetpack module is inactive.', 'jetpack' ), array( 'status' => 409 ) ); |
|
471 | } |
|
472 | } |
|
473 | ||
474 | // Get parameters to update the module. We can not simply use $request->get_params() because when we registered |