Last active
July 8, 2017 03:20
-
-
Save ekandreas/8cc5cd5e29e1a8d83fb4 to your computer and use it in GitHub Desktop.
Block external WordPress API request
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
/** | |
* Block external WordPress API request | |
*/ | |
function wp_api_block_request($pre, $args, $url) | |
{ | |
if (strpos($url, 'api.wordpress.org')) { | |
return true; | |
} else { | |
return $pre; | |
} | |
} | |
add_filter('pre_http_request', 'wp_api_block_request', 10, 3); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment