| @@ 601-603 (lines=3) @@ | ||
| 598 | $param = $request->get_params(); |
|
| 599 | ||
| 600 | // Exit if no parameters were passed. |
|
| 601 | if ( ! is_array( $param ) ) { |
|
| 602 | return new WP_Error( 'missing_setting', esc_html__( 'Missing setting.', 'jetpack' ), array( 'status' => 404 ) ); |
|
| 603 | } |
|
| 604 | ||
| 605 | // Get option name and value. |
|
| 606 | $option = key( $param ); |
|
| @@ 433-435 (lines=3) @@ | ||
| 430 | } |
|
| 431 | ||
| 432 | // Exit if no parameters were passed. |
|
| 433 | if ( ! is_array( $params ) ) { |
|
| 434 | return new WP_Error( 'missing_options', esc_html__( 'Missing options.', 'jetpack' ), array( 'status' => 404 ) ); |
|
| 435 | } |
|
| 436 | ||
| 437 | // If $params was set via `get_body_params()` there may be some additional variables in the request that can |
|
| 438 | // cause validation to fail. This method verifies that each param was in fact updated and will throw a `some_updated` |
|
| @@ 1054-1063 (lines=10) @@ | ||
| 1051 | } |
|
| 1052 | ||
| 1053 | $verification_services_codes = get_option( 'verification_services_codes' ); |
|
| 1054 | if ( |
|
| 1055 | ! is_array( $verification_services_codes ) |
|
| 1056 | || empty( $verification_services_codes ) |
|
| 1057 | ) { |
|
| 1058 | return new WP_Error( |
|
| 1059 | 'empty', |
|
| 1060 | esc_html__( 'Site not verified with any service.', 'jetpack' ), |
|
| 1061 | array( 'status' => 404 ) |
|
| 1062 | ); |
|
| 1063 | } |
|
| 1064 | ||
| 1065 | $services = array(); |
|
| 1066 | foreach ( jetpack_verification_services() as $name => $service ) { |
|