Created
November 13, 2013 19:35
-
-
Save tott/7454982 to your computer and use it in GitHub Desktop.
Force http referer for imports to bypass some bad servers who would not want to serve the static assets otherwise
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 characters
add_filter( 'http_request_args', 'force_referer_for_import' ); | |
function force_referer_for_import( $r ) { | |
if ( defined( 'WP_IMPORTING' ) && WP_IMPORTING ) { | |
$r['headers']['Referer'] = 'http://<referer>/'; | |
} | |
return $r; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment