我想更改Wordpress注销屏幕的标题。
我计划在“wp\\u login\\u errors”上使用过滤器来更改正文文本,但我不知道如何从“Wordpress失败通知”更改页面标题。如何更改注销屏幕标题
1 个回复
SO网友:Ihor Vorotnov
首先,如果你看到这个页面,这意味着你以错误的方式注销。这个check_admin_referer()
失败和调用wp_nonce_ays()
, 从而提示确认(ays = Are公司You公司S是吗?)。有关更多详细信息,请参阅以下线程:
- How to log out without confirmation 'Do you really want to log out?"?
- WordPress failure when logging out
- wp_logout_url() - WordPress Failure Notice
文本字符串本身位于wp includes/functions的第2607行。php:
如你所见,没有过滤器。但是,它是传递给的字符串wp_die( $html, __( \'WordPress Failure Notice\' ), 403 );
__()
函数,这意味着您可以使用gettext
:function wpse283987_change_string( $translated_text, $untranslated_text ) { global $pagenow; if( $pagenow === \'wp-login.php\' && $untranslated_text === \'WordPress Failure Notice\' ) { return __( \'Your New Text\' ); } return $translated_text; } add_filter( \'gettext\', \'wpse283987_change_string\', 20, 2 );
结束