Skip to content

Instantly share code, notes, and snippets.

@AmyrAhmady
Last active September 8, 2020 23:38
Show Gist options
  • Save AmyrAhmady/dbbcb9bfeeadeb807be078a494d5fb5b to your computer and use it in GitHub Desktop.
Save AmyrAhmady/dbbcb9bfeeadeb807be078a494d5fb5b to your computer and use it in GitHub Desktop.
redirect wp default register page to custom made one
<?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