php 更改TEXT登录Wordpress

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了php 更改TEXT登录Wordpress相关的知识,希望对你有一定的参考价值。

add_filter( 'gettext', 'wpse17709_gettext', 10, 2 );
function wpse17709_gettext( $custom_translation, $login_texts ) {

    // Login Main Page
    if ( 'Username' == $login_texts ) { return ''; } // Username Label
    if ( 'Password' == $login_texts ) { return ''; } // Password Label
    if ( 'Remember Me' == $login_texts ) { return ''; } // Remember Checkbox
    if ( 'Log In' == $login_texts ) { return ''; } // Login Button
    if ( 'Lost your password?' == $login_texts ) { return ''; } // Lost Password Link
    if ( '← Back to %s' == $login_texts ) { return ''; } // Back to website

    // Login New Password
    if ( 'Please enter your username or email address. You will receive a link to create a new password via email.' == $login_texts ) { return ''; } // Message after logo
    if ( 'Username or E-mail:' == $login_texts ) { return ''; } // Label of username input
    if ( 'Log in' == $login_texts ) { return ''; } // Log In Link Text
    if ( 'Get New Password' == $login_texts ) { return ''; } // Button

    // Messages
    if ( 'You are now logged out.' == $login_texts ) { return ''; } // Log out message
    if ( 'User registration is currently not allowed.' == $login_texts ) { return ''; } // User registration disabled
    if ( 'Check your e-mail for the confirmation link.' == $login_texts ) { return ''; } // Check link confirmation on email
    if ( 'Check your e-mail for your new password.' == $login_texts ) { return ''; } // Check new password on email
    if ( 'Registration complete. Please check your e-mail.' == $login_texts ) { return ''; } // Registration complete
    if ( 'Your session has expired. Please log-in again.' == $login_texts ) { return ''; } // Expired Session
    if ( '<strong>You have successfully updated WordPress!</strong> Please log back in to experience the awesomeness.' == $login_texts ) { return ''; } // Sucessfully Wordpress Updated

    return $translation;

}

以上是关于php 更改TEXT登录Wordpress的主要内容,如果未能解决你的问题,请参考以下文章

PHP Wordpress的自定义登录页面更改

PHP 更改WordPress管理员和登录页面徽标

Wordpress的自定义登录页更改

更改WordPress管理和登录页面徽标

Wordpress更改后台地址

如何仅更改 wordpress 主题中的文本?