blocks
4 years ago
build
4 years ago
fonts
8 years ago
genericons
6 years ago
lib
4 years ago
social-logos
5 years ago
accessible-focus.js
5 years ago
class.jetpack-provision.php
4 years ago
connect-button.js
4 years ago
crowdsignal-shortcode.js
5 years ago
crowdsignal-survey.js
5 years ago
facebook-embed.js
4 years ago
gallery-settings.js
5 years ago
genericons.php
4 years ago
jetpack-admin.js
5 years ago
jetpack-connection-banner.js
4 years ago
jetpack-deactivate-dialog.js
5 years ago
jetpack-modules.js
4 years ago
jetpack-modules.models.js
4 years ago
jetpack-modules.views.js
4 years ago
jetpack-recommendations-banner.js
5 years ago
jetpack-server-sandbox.php
4 years ago
polldaddy-shortcode.js
5 years ago
social-logos.php
5 years ago
twitter-timeline.js
5 years ago
jetpack-server-sandbox.php
39 lines
| 1 | <?php |
| 2 | /** |
| 3 | * This feature is only useful for Automattic developers. |
| 4 | * It configures Jetpack to talk to staging/sandbox servers |
| 5 | * on WordPress.com instead of production servers. |
| 6 | * |
| 7 | * @package automattic/jetpack |
| 8 | */ |
| 9 | |
| 10 | /** |
| 11 | * Provides sandbox request parameters. |
| 12 | * |
| 13 | * @param string $sandbox Sandbox domain. |
| 14 | * @param string $url URL of request about to be made. |
| 15 | * @param array $headers Headers of request about to be made. |
| 16 | * @return array [ 'url' => new URL, 'host' => new Host ]. |
| 17 | */ |
| 18 | function jetpack_server_sandbox_request_parameters( $sandbox, $url, $headers ) { |
| 19 | _deprecated_function( __METHOD__, 'jetpack-10.2', 'Automattic\\Jetpack\\Server_Sandbox::server_sandbox_request_parameters' ); |
| 20 | |
| 21 | return ( new Automattic\Jetpack\Server_Sandbox() )->server_sandbox_request_parameters( $sandbox, $url, $headers ); |
| 22 | } |
| 23 | |
| 24 | /** |
| 25 | * Modifies parameters of request in order to send the request to the |
| 26 | * server specified by `JETPACK__SANDBOX_DOMAIN`. |
| 27 | * |
| 28 | * Attached to the `requests-requests.before_request` filter. |
| 29 | * |
| 30 | * @param string $url URL of request about to be made. |
| 31 | * @param array $headers Headers of request about to be made. |
| 32 | * @return void |
| 33 | */ |
| 34 | function jetpack_server_sandbox( &$url, &$headers ) { |
| 35 | _deprecated_function( __METHOD__, 'jetpack-10.2', 'Automattic\\Jetpack\\Server_Sandbox::server_sandbox' ); |
| 36 | |
| 37 | ( new Automattic\Jetpack\Server_Sandbox() )->server_sandbox( $url, $headers ); |
| 38 | } |
| 39 |