@@ 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( |
|
@@ 478-480 (lines=3) @@ | ||
475 | // It will not be passed. It's just checked in this method to pass that method a string or array. |
|
476 | $request['slug'] = 'any'; |
|
477 | } else { |
|
478 | if ( ! Jetpack::is_module( $request['slug'] ) ) { |
|
479 | return new WP_Error( 'not_found', esc_html__( 'The requested Jetpack module was not found.', 'jetpack' ), array( 'status' => 404 ) ); |
|
480 | } |
|
481 | ||
482 | if ( ! Jetpack::is_module_active( $request['slug'] ) ) { |
|
483 | return new WP_Error( 'inactive', esc_html__( 'The requested Jetpack module is inactive.', 'jetpack' ), array( 'status' => 409 ) ); |