Skip to content

Instantly share code, notes, and snippets.

@ekandreas
Last active July 8, 2017 03:20
Show Gist options
  • Save ekandreas/8cc5cd5e29e1a8d83fb4 to your computer and use it in GitHub Desktop.
Save ekandreas/8cc5cd5e29e1a8d83fb4 to your computer and use it in GitHub Desktop.
Block external WordPress API request
/**
* 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