Skip to content

Instantly share code, notes, and snippets.

@setola
Last active June 27, 2016 14:44
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save setola/8456688 to your computer and use it in GitHub Desktop.
Save setola/8456688 to your computer and use it in GitHub Desktop.
WordPress - Enable custom repository from local ip
<?php
/** Enable my local themes and plugins repository FFS!!! */
add_filter( 'http_request_host_is_external', 'allow_my_custom_host', 10, 3 );
function allow_my_custom_host( $allow, $host, $url ) {
if ( $host == 'put.your-repository-domain-here.com' )
$allow = true;
return $allow;
}
@scrobbleme
Copy link

Thanks for this snippet.

You could simplify it a little:

add_filter( 'http_request_host_is_external', 'allow_my_custom_host', 10, 3 );
function allow_my_custom_host( $allow, $host, $url ) {
     return $host == 'put.your-repository-domain-here.com'  || $allow;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment