| @@ 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 | ||
| @@ 817-823 (lines=7) @@ | ||
| 814 | break; |
|
| 815 | } |
|
| 816 | ||
| 817 | if ( $updated ) { |
|
| 818 | return rest_ensure_response( array( |
|
| 819 | 'code' => 'success', |
|
| 820 | 'message' => esc_html__( 'Setting updated.', 'jetpack' ), |
|
| 821 | 'value' => $value, |
|
| 822 | ) ); |
|
| 823 | } |
|
| 824 | ||
| 825 | return new WP_Error( 'setting_not_updated', esc_html__( 'The setting was not updated.', 'jetpack' ), array( 'status' => 400 ) ); |
|
| 826 | } |
|
| @@ 1154-1160 (lines=7) @@ | ||
| 1151 | } |
|
| 1152 | ||
| 1153 | // If all Jumpstart modules were activated |
|
| 1154 | if ( empty( $result['failed_modules'] ) ) { |
|
| 1155 | return rest_ensure_response( array( |
|
| 1156 | 'code' => 'success', |
|
| 1157 | 'message' => esc_html__( 'Jumpstart done.', 'jetpack' ), |
|
| 1158 | 'data' => $result, |
|
| 1159 | ) ); |
|
| 1160 | } |
|
| 1161 | ||
| 1162 | 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 ) ); |
|
| 1163 | } |
|