Last active
September 26, 2024 17:02
Revisions
-
JoelLisenby revised this gist
Sep 26, 2024 . 1 changed file with 4 additions and 12 deletions.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,24 +1,16 @@ <?php // Add to functions.php or your own plugin add_filter('http_request_args', 'apply_proxy_for_updates', 10, 2); function apply_proxy_for_updates($http_args, $url) { // Check if the URL is for an update check or download if (strpos($url, 'wordpress.org') !== false) { $http_args['proxy'] = array( 'host' => 'your.proxy.server', 'port' => 'proxy_port_number', // Add username and password if your proxy requires authentication 'username' => 'your_username', 'password' => 'your_password', ); } return $http_args; -
JoelLisenby revised this gist
Sep 26, 2024 . 1 changed file with 4 additions and 4 deletions.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -14,11 +14,11 @@ function apply_proxy_for_updates($http_args, $url) { // Check if the URL is for an update check or download if (strpos($url, 'wordpress.org') !== false) { $http_args['proxy'] = array( 'host' => WP_PROXY_HOST, 'port' => WP_PROXY_PORT, // Add username and password if your proxy requires authentication 'username' => WP_PROXY_USERNAME, 'password' => WP_PROXY_PASSWORD, ); } return $http_args; -
JoelLisenby created this gist
Sep 26, 2024 .There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,27 @@ <?php // Add to functions.php or your own plugin define('WP_PROXY_HOST', 'your.proxy.server'); define('WP_PROXY_PORT', 'proxy_port_number'); define('WP_PROXY_USERNAME', 'your_username'); define('WP_PROXY_PASSWORD', 'your_password'); // Optional, if you need to bypass proxy for local addresses // define('WP_PROXY_BYPASS_HOSTS', 'localhost, www.example.com'); add_filter('http_request_args', 'apply_proxy_for_updates', 10, 2); function apply_proxy_for_updates($http_args, $url) { // Check if the URL is for an update check or download if (strpos($url, 'wordpress.org') !== false) { $http_args['proxy'] = array( 'host' => 'your.proxy.server', 'port' => 'proxy_port_number', // Add username and password if your proxy requires authentication 'username' => 'your_username', 'password' => 'your_password', ); } return $http_args; } ?>