我们如何检查用户是否正在登录或注册?

时间:2012-07-06 作者:Andrew Welch

我正在使用此筛选器更改登录页面上的文本:

function filter_register_text() {
    return "<p class=\'message register\'>Registering for this site will give you access to the admin panel to add new products with images and useful files for others to download and choose open product licenses.</p>";
}

add_filter(\'login_message\', \'filter_register_text\');
如果用户signs up 在网站上,而不是只想log in.

谢谢

1 个回复
最合适的回答,由SO网友:TheDeadMedic 整理而成

我想你最好的办法是检查action 参数已设置(&S);等于register:

if ( isset( $_REQUEST[\'action\'] ) && $_REQUEST[\'action\'] == \'register\' )
    add_filter( \'login_message\', \'filter_register_text\' );

结束

相关推荐

其中是wp-login.php中的查询

我正在WordPress中制作一个登录表单,我想对其进行验证,所以我尝试查看wp登录。php来查看它们是如何验证的。但我没有找到我要找的东西。我想知道他们如何验证东西,或者他们需要什么输入来验证东西。我试着搜索WordPress论坛,我能找到的只有插件、插件和更多插件。我不想要插件。我想硬编码。所以请帮帮我。我想知道在哪里可以找到搜索用户用户名和密码的部分。如果没有,请知道成功登录需要什么。例如用户名或密码或其他。顺便说一下,这里是wp-login.php. 谢谢