Last active
March 15, 2021 16:45
-
-
Save abaicus/80e8884b33038be288ec056ac1d0e810 to your computer and use it in GitHub Desktop.
ngrok mu-plugins drop-in for WordPress
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
<?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