如何检查用户注册是否被允许/激活?

时间:2014-11-08 作者:Iurie

如果允许用户注册,我需要运行代码段,但我找不到解决方案。如何做到这一点?

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

您可以借助get_option.

下面是一个简单的代码,用于检查是否允许用户注册。

if ( get_option( \'users_can_register\' ) ) {

    // Your custom code or message to display if user registration is allowed.

}
get_option( \'users_can_register\' ) 返回布尔值true(1)或false(0)。

结束

相关推荐