How would I create a wordpress function that will redirect a user to myurl.com/wp-admin if they type in myurl.com/admin?
I would like to have this as a wordpress function.
How would I create a wordpress function that will redirect a user to myurl.com/wp-admin if they type in myurl.com/admin?
I would like to have this as a wordpress function.
Comments are closed.
Hook into
template_redirect
, inspect the request URI, and redirect to the return value ofadmin_url()
.Note: always use
admin_url()
and the other built-in URL functions, because they will take care of the proper scheme (https
orhttp
).