简体   繁体   English

如何获取wp-login.php请求的action参数?

[英]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. 我正在尝试将自定义用户系统与Wordpress集成在一起,最近我问了一个有关如何将请求重定向到wp-login.php到我自己的登录/注册页面的问题,但是当我在使用可插拔功能时,我意识到对wp-login.php的请求可以用于登录,注册或注销。

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. 先感谢您。

Well, I've just had a massive D'oh moment. 好吧,我刚刚度过了一个沉重的D'oh时刻。

The request is something like: wp-login.php?action=logout 该请求类似于:wp-login.php?action = logout

To get the action, I simply need to $_GET['action'] or $_REQUEST['action']. 要获得动作,我只需要$ _GET ['action']或$ _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). 我不敢相信它只是没有出现在我身上(我猜是因为它是Wordpress,我一直在想有一种特殊的方法可以做到这一点,甚至没有想到像往常一样得到它)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM