Last active
August 29, 2015 14:09
-
-
Save spacedmonkey/77e7299e10204414fafb to your computer and use it in GitHub Desktop.
This file contains hidden or 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 characters
function change_aggregator_remote_get_url($url){ | |
$parse = parse_url($url); | |
return str_replace($parse['host'], "localhost", $url); | |
} | |
add_filter('aggregator_remote_get_url', 'change_aggregator_remote_get_url'); | |
function change_aggregator_remote_get_args($args, $url){ | |
$parse = parse_url($url); | |
$args['blocking'] = true; // Not required for us | |
$headers = (array)$args['headers']; | |
$headers['host'] = $parse['host']; | |
$args['headers'] = $headers; | |
return $args; | |
} | |
add_filter('aggregator_remote_get_args', 'change_aggregator_remote_get_args', 10, 2); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment