| @@ 239-244 (lines=6) @@ | ||
| 236 | } |
|
| 237 | } |
|
| 238 | ||
| 239 | if ( empty( $failed ) ) { |
|
| 240 | return rest_ensure_response( array( |
|
| 241 | 'code' => 'success', |
|
| 242 | 'message' => esc_html__( 'All modules activated.', 'jetpack' ), |
|
| 243 | ) ); |
|
| 244 | } |
|
| 245 | ||
| 246 | $error = ''; |
|
| 247 | ||
| @@ 853-859 (lines=7) @@ | ||
| 850 | break; |
|
| 851 | } |
|
| 852 | ||
| 853 | if ( $updated ) { |
|
| 854 | return rest_ensure_response( array( |
|
| 855 | 'code' => 'success', |
|
| 856 | 'message' => esc_html__( 'Setting updated.', 'jetpack' ), |
|
| 857 | 'value' => $value, |
|
| 858 | ) ); |
|
| 859 | } |
|
| 860 | ||
| 861 | return new WP_Error( 'setting_not_updated', esc_html__( 'The setting was not updated.', 'jetpack' ), array( 'status' => 400 ) ); |
|
| 862 | } |
|
| @@ 1190-1196 (lines=7) @@ | ||
| 1187 | } |
|
| 1188 | ||
| 1189 | // If all Jumpstart modules were activated |
|
| 1190 | if ( empty( $result['failed_modules'] ) ) { |
|
| 1191 | return rest_ensure_response( array( |
|
| 1192 | 'code' => 'success', |
|
| 1193 | 'message' => esc_html__( 'Jumpstart done.', 'jetpack' ), |
|
| 1194 | 'data' => $result, |
|
| 1195 | ) ); |
|
| 1196 | } |
|
| 1197 | ||
| 1198 | return new WP_Error( 'jumpstart_failed', esc_html( sprintf( _n( 'Jumpstart failed activating this module: %s.', 'Jumpstart failed activating these modules: %s.', count( $result['failed_modules'] ), 'jetpack' ), join( ', ', $result['failed_modules'] ) ) ), array( 'status' => 400 ) ); |
|
| 1199 | } |
|