Skip to content

Instantly share code, notes, and snippets.

@abaicus
Last active March 15, 2021 16:45
Show Gist options
  • Save abaicus/80e8884b33038be288ec056ac1d0e810 to your computer and use it in GitHub Desktop.
Save abaicus/80e8884b33038be288ec056ac1d0e810 to your computer and use it in GitHub Desktop.
ngrok mu-plugins drop-in for WordPress
<?php
if ( strpos( $_SERVER['HTTP_HOST'], 'ngrok' ) ) {
add_filter( "option_siteurl", 'adapt_ngrok' );
add_filter( "option_home", 'adapt_ngrok' );
}
function adapt_ngrok() {
return 'http://' . $_SERVER['HTTP_HOST'];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment