| @@ 1734-1736 (lines=3) @@ | ||
| 1731 | public static function register_site( $request ) { |
|
| 1732 | _deprecated_function( __METHOD__, 'jetpack-8.8.0', '\Automattic\Jetpack\Connection\REST_Connector::connection_register' ); |
|
| 1733 | ||
| 1734 | if ( ! wp_verify_nonce( $request->get_param( 'registration_nonce' ), 'jetpack-registration-nonce' ) ) { |
|
| 1735 | return new WP_Error( 'invalid_nonce', __( 'Unable to verify your request.', 'jetpack' ), array( 'status' => 403 ) ); |
|
| 1736 | } |
|
| 1737 | ||
| 1738 | if ( isset( $request['from'] ) ) { |
|
| 1739 | Jetpack::connection()->add_register_request_param( 'from', (string) $request['from'] ); |
|
| @@ 424-426 (lines=3) @@ | ||
| 421 | * @return \WP_REST_Response|WP_Error |
|
| 422 | */ |
|
| 423 | public function connection_register( $request ) { |
|
| 424 | if ( ! wp_verify_nonce( $request->get_param( 'registration_nonce' ), 'jetpack-registration-nonce' ) ) { |
|
| 425 | return new WP_Error( 'invalid_nonce', __( 'Unable to verify your request.', 'jetpack' ), array( 'status' => 403 ) ); |
|
| 426 | } |
|
| 427 | ||
| 428 | if ( isset( $request['from'] ) ) { |
|
| 429 | $this->connection->add_register_request_param( 'from', (string) $request['from'] ); |
|