WordPress注册消息

时间:2018-04-04 作者:koy

我手动批准WordPress网站上的用户注册。我的问题是,我想编辑他们在我的网站上注册时看到的消息:

WordPress Registration Message

问题是,我找不到编辑该消息的位置。尝试查看wp-login.phpwp-signup.php 但找不到包含该消息的代码。有人能告诉我在哪里可以编辑它吗?

1 个回复
SO网友:Dave Romsey

此消息不是WordPress核心的一部分。我通过在WordPress核心文件中搜索消息来证实这一怀疑。没有找到时,我用搜索引擎搜索了这条消息。您似乎正在使用New User Approve Message plugin.

此消息在中定义new-user-approve/includes/messages.php#L33

/**
 * The default message that will be shown to the user after registration has completed.
 *
 * @return string
 */
function nua_default_registration_complete_message() {
    $message = sprintf( __( \'An email has been sent to the site administrator. The administrator will review the information that has been submitted and either approve or deny your request.\', \'new-user-approve\' ) );
    $message .= \' \';
    $message .= sprintf( __( \'You will receive an email with instructions on what you will need to do next. Thanks for your patience.\', \'new-user-approve\' ) );
    $message = apply_filters( \'new_user_approve_pending_message_default\', $message );
    return $message;
}
您可以使用筛选器修改此消息new_user_approve_pending_message_default.

add_filter( \'new_user_approve_pending_message_default\',
            \'wpse_new_user_approve_pending_message_default\' );
function wpse_new_user_approve_pending_message_default( $message ) {
    // Customize $new_message as needed and return it.
    $new_message = sprintf( __( \'New message...\', \'text-domain\' ) );

    return $new_message;
}

结束

相关推荐

Custom Login Process

我们目前有一个登录过程,该过程使用首页来处理登录过程,然后将用户重定向回首页并登录。这一过程的部分原因是有几个不同的平台已经迁移到我们即将推出的单一wordpress中。问题是,用户有几种不同的登录方式,包括电子邮件地址、遗留系统中存在的用户名、另一个系统中生成的id以及我们当前唯一的数字id。目前可以使用所有4种不同的方法通过第三方平台登录。我们的业务指示我们保留此功能。我的想法是在登录过程中捕获提交,调用rest服务并将提交的id传递给他们,然后该服务将返回标准化的id,然后使用wordpress登录