Extend the List of Allowed Domains for wp_safe_redirect()
What is the difference between using wp_redirect()
and wp_safe_redirect()
functions actually?
The thing is that wp_redirect()
allows to perform redirections just anywhere, but wp_safe_redirect()
by default allows only the domain specified as Site Address (URL) in Settings > General.
In this tutorial I will show you how you can add any domain as an allowed domain for wp_safe_redirect()
function using allowed_redirect_hosts
action hook.
RFC 5322 Support for is_email() function. Quick fix.
I was quite suprised when I tested his email something+something@anything.com
and found out that the default WordPress function is_email()
returns false for this type of emails. In other words, is_email()
function isn’t able to validate email addresses with a “+” in it but those are valid email addresses as well as per RFC standard 5322. By the way, if you look at the official documentation of is_email()
function, there also said that it is not RFC compliant.