|
@@ 114-120 (lines=7) @@
|
| 111 |
|
$module_slug = $request; |
| 112 |
|
} |
| 113 |
|
|
| 114 |
|
if ( ! Jetpack::is_module( $module_slug ) ) { |
| 115 |
|
return new WP_Error( |
| 116 |
|
'not_found', |
| 117 |
|
esc_html__( 'The requested Jetpack module was not found.', 'jetpack' ), |
| 118 |
|
array( 'status' => 404 ) |
| 119 |
|
); |
| 120 |
|
} |
| 121 |
|
|
| 122 |
|
if ( ! Jetpack::is_module_active( $module_slug ) ) { |
| 123 |
|
return new WP_Error( |
|
@@ 62-68 (lines=7) @@
|
| 59 |
|
$module_slug = $request; |
| 60 |
|
} |
| 61 |
|
|
| 62 |
|
if ( ! Jetpack::is_module( $module_slug ) ) { |
| 63 |
|
return new WP_Error( |
| 64 |
|
'not_found', |
| 65 |
|
esc_html__( 'The requested Jetpack module was not found.', 'jetpack' ), |
| 66 |
|
array( 'status' => 404 ) |
| 67 |
|
); |
| 68 |
|
} |
| 69 |
|
|
| 70 |
|
if ( Jetpack::activate_module( $module_slug, false, false ) ) { |
| 71 |
|
return rest_ensure_response( array( |
|
@@ 512-514 (lines=3) @@
|
| 509 |
|
// It will not be passed. It's just checked in this method to pass that method a string or array. |
| 510 |
|
$request['slug'] = 'any'; |
| 511 |
|
} else { |
| 512 |
|
if ( ! Jetpack::is_module( $request['slug'] ) ) { |
| 513 |
|
return new WP_Error( 'not_found', esc_html__( 'The requested Jetpack module was not found.', 'jetpack' ), array( 'status' => 404 ) ); |
| 514 |
|
} |
| 515 |
|
|
| 516 |
|
if ( ! Jetpack::is_module_active( $request['slug'] ) ) { |
| 517 |
|
return new WP_Error( 'inactive', esc_html__( 'The requested Jetpack module is inactive.', 'jetpack' ), array( 'status' => 409 ) ); |