朋友们,我有个问题。当我进入wordpress中的默认logn页面时,我看到了这个错误:
Notice: login_headertitle is deprecated since version 5.2.0! Use login_headertext instead. Usage of the title attribute on the login logo is not recommended for accessibility reasons. Use the link text instead. in /home/xxxxxxx/public_html/wp-includes/functions.php on line 4711
我正在使用wp veroin 5.2.1 我不使用任何插件来自定义登录页面。我在自己的文件中搜索了很多,但没有找到login_headertitle. 我只是在中使用以下代码functions.php 对于登录页面的自定义css:
function custom_login_css() {
wp_enqueue_style( \'mylogincss\', get_template_directory_uri() . \'/css/custom-login-styles.css\' );
}
add_action(\'login_head\', \'custom_login_css\');
所以我很困惑,为什么我在登录页面的顶部看到这个错误<你能帮我修一下吗?
SO网友:Jeremy Tarpley
正如错误所述,WordPress不推荐使用login\\u headertitle函数。您很可能有一个插件或父主题正在使用此功能更改登录页面上的标题。检查插件和主题文件是否有任何更新。
看到此消息还表明您已在站点上启用调试。如果它是一个未在其上开发的实时站点,则可能需要禁用它。或者,您可以保持为开发启用调试,并将其记录到文件中,而不是显示在屏幕上。Wordpress.org has documentation on debugging.
如果您正在开发使用login\\u headertitle的主题或插件,那么很容易解决。如果对login\\u headertitle有add\\u操作或其他函数调用,只需将其替换为login\\u headertext即可。这是an example from the WordPress Code Reference for the login_headertext function:
// Customize login header text.
add_filter( \'login_headertext\', \'customize_login_headertext\' );
function customize_login_headertext( $headertext ) {
$headertext = esc_html__( \'Add custom login page text here\', \'plugin-textdomain\' );
return $headertext;
}