@@ 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( |
|
@@ 495-497 (lines=3) @@ | ||
492 | // It will not be passed. It's just checked in this method to pass that method a string or array. |
|
493 | $request['slug'] = 'any'; |
|
494 | } else { |
|
495 | if ( ! Jetpack::is_module( $request['slug'] ) ) { |
|
496 | return new WP_Error( 'not_found', esc_html__( 'The requested Jetpack module was not found.', 'jetpack' ), array( 'status' => 404 ) ); |
|
497 | } |
|
498 | ||
499 | if ( ! Jetpack::is_module_active( $request['slug'] ) ) { |
|
500 | return new WP_Error( 'inactive', esc_html__( 'The requested Jetpack module is inactive.', 'jetpack' ), array( 'status' => 409 ) ); |