更改WordPress的登录标签”用户名”

在默认的WordPress登录页面上, 如何将标签” Username”更改为其他名称?


#1


我认为这是以前答案的更好替代方案。

function login_function() {
    add_filter( 'gettext', 'username_change', 20, 3 );
    function username_change( $translated_text, $text, $domain ) 
    {
        if ($text === 'Username') 
        {
            $translated_text = 'customLoginName';
        }
        return $translated_text;
    }
}
add_action( 'login_head', 'login_function' );

#2


简单的解决方案

add_filter(  'gettext', 'register_text'  );
function register_text( $translating ) {
    $translated = str_ireplace(  'Username or Email Address', 'Your Custom Text', $translating );
    return $translated;
}

来源:

https://www.srcmini02.com/62487.html

微信公众号
手机浏览(小程序)

Warning: get_headers(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57

Warning: get_headers(): Failed to enable crypto in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57

Warning: get_headers(https://static.shanhubei.com/qrcode/qrcode_viewid_42269.jpg): failed to open stream: operation failed in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57
0
分享到:
没有账号? 忘记密码?