更改插件主题我的登录中的成功消息

时间:2012-10-31 作者:pixelngrain

我正在使用主题我的登录插件,希望在人们注册时替换消息,并将其重定向回登录页面,在表单顶部显示消息。

Message:Your registration was successful but you must now confirm your email address before you can log in. Please check your email and click on the link provided.

我要替换此邮件。

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

当插入主题的函数时,以下内容应按原样工作(使用新消息的字符串和主题的文本域)。php:

function wpse71032_change_tml_registration_message( $translated_text, $text, $domain ) {
    if( $domain === \'theme-my-login\' &&
        $text === \'Your registration was successful but you must now confirm your email address before you can log in. Please check your email and click on the link provided.\'
    ) {
        /* in the below, change the first argument to the message you want
           and the second argument to your theme\'s textdomain */
        $translated_text = __( \'%Registration Message%\', \'theme_text_domain\' );
    }
    return $translated_text;
}
add_filter( \'gettext\', \'wpse71032_change_tml_registration_message\', 20, 3 );
请参见the article on the gettext filter 在筛选器引用中。

结束

相关推荐

如何将wp-login.php重命名为MultiSite?

我想隐藏并重命名wp-login.php 在我的URL中,用于在多站点设置上创建品牌。从这个forum post 我知道我可以改变mysite.com/wp-login.php 到mysite.com/login 通过插入RewriteRule ^login$ wp-login.php 在我的.htaccess. 我喜欢URL栏不显示登录重定向到wp登录。如果我尝试在子网站下登录mysite.com/subsite1/login 它显示为重定向自mysite.com/subsite1/wp-login