Codex code causing PHP Deprecated: login_headertitle
-
Hello All
I noticed this repeated entry in my debug.log while I had the debugger running:
PHP Deprecated: 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/xxxxxx/xxxxxx.com/wp-includes/functions.php on line 5586
I tracked this down to an entry in the child theme’s functions.php which was taken from the WordPress Codex on how to change the login page logo:
https://codex.ww.wp.xz.cn/Customizing_the_Login_Form#Change_the_Login_Logo
This section of code is causing the error:
function my_login_logo_url_title() {
return ‘Your Site Name and Info’;
}
add_filter( ‘login_headertitle’, ‘my_login_logo_url_title’ );I found this page about the new headertext that’s referred to in the error message:
https://developer.ww.wp.xz.cn/reference/hooks/login_headertext/And replacing the old code with the new code resolves the issue:
// Customize login header text.
add_filter( ‘login_headertext’, ‘wpdoc_customize_login_headertext’ );function wpdoc_customize_login_headertext( $headertext ) {
$headertext = esc_html__( ‘Welcome to WordPress’, ‘plugin-textdomain’ );
return $headertext;
}Could anyone let me know how I can alert the Codex admins of the out of date code? I’ve had a search around and couldn’t find a way.
Thanks!
The page I need help with: [log in to see the link]
The topic ‘Codex code causing PHP Deprecated: login_headertitle’ is closed to new replies.