Sunday, March 20, 2011

How to get the action argument of a wp-login.php request?

I am trying to integrate my custom user system with Wordpress, and I have recently asked a question on how to redirect requests to wp-login.php to my own login/registration page, but as I was working on the pluggable functions, I realized that requests to wp-login.php can either be for login, registration, or log out.

This is set in the action argument that's made in the request. What I am trying to figure out is how to get this action argument, so I can redirect the request to my custom pages. Is there any way of doing this?

Thank you in advance.

From stackoverflow
  • Well, I've just had a massive D'oh moment.

    The request is something like: wp-login.php?action=logout

    To get the action, I simply need to $_GET['action'] or $_REQUEST['action']. I can't believe it just didn't come to me (I guess because it was Wordpress, I kept thinking there was a special way to do it, and didn't even think of getting it as I normally would).

    nickohrn : Exactly correct.

0 comments:

Post a Comment