kollapsminoriteten/wp-content/plugins/jetpack/_inc/jetpack-server-sandbox.php

39 lines
1.4 KiB
PHP
Raw Normal View History

2019-11-15 23:26:29 +01:00
<?php
/**
* This feature is only useful for Automattic developers.
* It configures Jetpack to talk to staging/sandbox servers
* on WordPress.com instead of production servers.
2021-09-07 21:40:48 +02:00
*
* @package automattic/jetpack
2019-11-15 23:26:29 +01:00
*/
/**
2021-09-07 21:40:48 +02:00
* Provides sandbox request parameters.
*
* @param string $sandbox Sandbox domain.
* @param string $url URL of request about to be made.
* @param array $headers Headers of request about to be made.
* @return array [ 'url' => new URL, 'host' => new Host ].
2019-11-15 23:26:29 +01:00
*/
function jetpack_server_sandbox_request_parameters( $sandbox, $url, $headers ) {
2022-04-02 10:26:41 +02:00
_deprecated_function( __METHOD__, 'jetpack-10.2', 'Automattic\\Jetpack\\Server_Sandbox::server_sandbox_request_parameters' );
2019-11-15 23:26:29 +01:00
2022-04-02 10:26:41 +02:00
return ( new Automattic\Jetpack\Server_Sandbox() )->server_sandbox_request_parameters( $sandbox, $url, $headers );
2019-11-15 23:26:29 +01:00
}
/**
* Modifies parameters of request in order to send the request to the
* server specified by `JETPACK__SANDBOX_DOMAIN`.
*
* Attached to the `requests-requests.before_request` filter.
2021-09-07 21:40:48 +02:00
*
* @param string $url URL of request about to be made.
* @param array $headers Headers of request about to be made.
2019-11-15 23:26:29 +01:00
* @return void
*/
function jetpack_server_sandbox( &$url, &$headers ) {
2022-04-02 10:26:41 +02:00
_deprecated_function( __METHOD__, 'jetpack-10.2', 'Automattic\\Jetpack\\Server_Sandbox::server_sandbox' );
2019-11-15 23:26:29 +01:00
2022-04-02 10:26:41 +02:00
( new Automattic\Jetpack\Server_Sandbox() )->server_sandbox( $url, $headers );
2019-11-15 23:26:29 +01:00
}