Last active
September 8, 2020 23:38
-
-
Save AmyrAhmady/dbbcb9bfeeadeb807be078a494d5fb5b to your computer and use it in GitHub Desktop.
redirect wp default register page to custom made one
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 wpse127636_register_url($link) { | |
return str_replace(site_url('wp-login.php?action=register', 'login'),site_url('ثبت-نام', 'login'),$link); | |
} | |
add_filter('register','wpse127636_register_url'); | |
function wpse127636_fix_register_urls($url, $path, $orig_scheme) { | |
if ($orig_scheme !== 'login') | |
return $url; | |
if ($path == 'wp-login.php?action=register') | |
return site_url('ثبت-نام', 'login'); | |
return $url; | |
} | |
add_filter('site_url', 'wpse127636_fix_register_urls', 10, 3); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment