Created
July 22, 2015 23:51
-
-
Save trepmal/18b4d1ec72bd2cf16753 to your computer and use it in GitHub Desktop.
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 | |
function tmp_change_home_url( $homeurl ) { | |
$old = 'example.com'; | |
$new = 'newsite.com'; | |
if ( strpos( $homeurl, $old ) !== false ) { | |
$homeurl = str_replace( $old, $new, $homeurl ); | |
} | |
return $homeurl; | |
} | |
add_filter( 'home_url', 'tmp_change_home_url' ); | |
#depending on scope, may need these... | |
#add_filter( 'site_url', 'tmp_change_home_url' ); | |
#add_filter( 'admin_url', 'tmp_change_home_url' ); | |
#add_filter( 'login_url', 'tmp_change_home_url' ); | |
#add_filter( 'redirect_canonical', 'tmp_change_home_url' ); | |
#add_filter( 'wp_redirect', 'tmp_change_home_url' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment