修改WordPress后台登陆表单中的用户名和密码标签

前端之家收集整理的这篇文章主要介绍了修改WordPress后台登陆表单中的用户名和密码标签前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

使用的过程中,很多时候我们想修改WordPress后台登陆表单中的用户名标签或密码标签:

user-pass-label

我们可以打开网站根目录,修改 wp-login.PHP 文件 或者打开翻译文件进行修改,但是当我们的wordpress网站版本升级以后,修改会被覆盖,我们需要重新修改。这篇wordpress教程里,我们就向大家介绍一种使用翻译钩子进行修改方法

切换到主题目录,打开 functions.PHP 文件,加入以下代码

Crayon-5c891cdf4bc99452016419" class="Crayon-Syntax Crayon-theme-classic Crayon-font-monaco Crayon-os-pc print-yes notranslate" data-settings=" minimize scroll-mouSEOver" style=" margin-top: 12px; margin-bottom: 12px; font-size: 12px !important; line-height: 15px !important;">
Crayon-toolbar" data-settings=" mouSEOver overlay hide delay" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">Crayon-title">functions.PHP
Crayon-tools" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
Crayon-button Crayon-nums-button" title="Toggle Line Numbers">
Crayon-button-icon">
Crayon-button Crayon-plain-button" title="Toggle Plain Code">
Crayon-button-icon">
Crayon-button Crayon-wrap-button" title="Toggle Line Wrap">
Crayon-button-icon">
Crayon-button Crayon-expand-button" title="Expand Code">
Crayon-button-icon">
Crayon-button Crayon-copy-button" title="Copy">
Crayon-button-icon">
Crayon-button Crayon-popup-button" title="Open Code In New Window">
Crayon-button-icon">
Crayon-language">PHP
Crayon-info" style="min-height: 16.8px !important; line-height: 16.8px !important;">
Crayon-plain-wrap">
Crayon-main" style="">Crayon-table">Crayon-row">
Crayon-nums " data-settings="show">
Crayon-nums-content" style="font-size: 12px !important; line-height: 15px !important;">
Crayon-num" data-line="Crayon-5c891cdf4bc99452016419-1">1
Crayon-num Crayon-striped-num" data-line="Crayon-5c891cdf4bc99452016419-2">2
Crayon-num" data-line="Crayon-5c891cdf4bc99452016419-3">3
Crayon-num Crayon-striped-num" data-line="Crayon-5c891cdf4bc99452016419-4">4
Crayon-num" data-line="Crayon-5c891cdf4bc99452016419-5">5
Crayon-num Crayon-striped-num" data-line="Crayon-5c891cdf4bc99452016419-6">6
Crayon-num" data-line="Crayon-5c891cdf4bc99452016419-7">7
Crayon-num Crayon-striped-num" data-line="Crayon-5c891cdf4bc99452016419-8">8
Crayon-num" data-line="Crayon-5c891cdf4bc99452016419-9">9
Crayon-num Crayon-striped-num" data-line="Crayon-5c891cdf4bc99452016419-10">10
Crayon-num" data-line="Crayon-5c891cdf4bc99452016419-11">11
Crayon-num Crayon-striped-num" data-line="Crayon-5c891cdf4bc99452016419-12">12
Crayon-num" data-line="Crayon-5c891cdf4bc99452016419-13">13
Crayon-num Crayon-striped-num" data-line="Crayon-5c891cdf4bc99452016419-14">14
Crayon-num" data-line="Crayon-5c891cdf4bc99452016419-15">15
Crayon-num Crayon-striped-num" data-line="Crayon-5c891cdf4bc99452016419-16">16
Crayon-num" data-line="Crayon-5c891cdf4bc99452016419-17">17
Crayon-num Crayon-striped-num" data-line="Crayon-5c891cdf4bc99452016419-18">18
Crayon-code">
Crayon-pre" style="font-size: 12px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;">
Crayon-line" id="Crayon-5c891cdf4bc99452016419-1">Crayon-c">//修改wordpress后台登陆表单中的用户名和密码标签
Crayon-line Crayon-striped-line" id="Crayon-5c891cdf4bc99452016419-2">Crayon-c">//https://www.jb51.cc
Crayon-line" id="Crayon-5c891cdf4bc99452016419-3">Crayon-t">functionCrayon-h"> Crayon-e">change_login_form_username_password_labelCrayon-sy">(Crayon-sy">)Crayon-h"> Crayon-sy">{
Crayon-line Crayon-striped-line" id="Crayon-5c891cdf4bc99452016419-4">Crayon-h">Crayon-e">add_filterCrayon-sy">(Crayon-h"> Crayon-s">'gettext'Crayon-sy">,Crayon-h"> Crayon-s">'username_password_change'Crayon-sy">,Crayon-h"> Crayon-cn">20Crayon-sy">,Crayon-h"> Crayon-cn">3Crayon-h"> Crayon-sy">)Crayon-sy">;
Crayon-line" id="Crayon-5c891cdf4bc99452016419-5">Crayon-h">Crayon-t">functionCrayon-h"> Crayon-e">username_password_changeCrayon-sy">(Crayon-h"> Crayon-v">$translated_textCrayon-sy">,Crayon-h"> Crayon-v">$textCrayon-sy">,Crayon-h"> Crayon-v">$domainCrayon-h"> Crayon-sy">)Crayon-h">
Crayon-line Crayon-striped-line" id="Crayon-5c891cdf4bc99452016419-6">Crayon-h">Crayon-sy">{
Crayon-line" id="Crayon-5c891cdf4bc99452016419-7">Crayon-h">Crayon-st">ifCrayon-h"> Crayon-sy">(Crayon-v">$textCrayon-h"> Crayon-o">===Crayon-h"> Crayon-s">'Username or Email'Crayon-sy">)Crayon-h">
Crayon-line Crayon-striped-line" id="Crayon-5c891cdf4bc99452016419-8">Crayon-h">Crayon-sy">{
Crayon-line" id="Crayon-5c891cdf4bc99452016419-9">Crayon-h">Crayon-v">$translated_textCrayon-h"> Crayon-o">=Crayon-h"> Crayon-s">'您的用户名'Crayon-sy">;
Crayon-line Crayon-striped-line" id="Crayon-5c891cdf4bc99452016419-10">Crayon-h">Crayon-sy">}
Crayon-line" id="Crayon-5c891cdf4bc99452016419-11">Crayon-h">Crayon-st">ifCrayon-h"> Crayon-sy">(Crayon-v">$textCrayon-h"> Crayon-o">===Crayon-h"> Crayon-s">'Password'Crayon-sy">)Crayon-h">
Crayon-line Crayon-striped-line" id="Crayon-5c891cdf4bc99452016419-12">Crayon-h">Crayon-sy">{
Crayon-line" id="Crayon-5c891cdf4bc99452016419-13">Crayon-h">Crayon-v">$translated_textCrayon-h"> Crayon-o">=Crayon-h"> Crayon-s">'您的密码'Crayon-sy">;
Crayon-line Crayon-striped-line" id="Crayon-5c891cdf4bc99452016419-14">Crayon-h">Crayon-sy">}
Crayon-line" id="Crayon-5c891cdf4bc99452016419-15">Crayon-h">Crayon-k ">returnCrayon-h"> Crayon-v">$translated_textCrayon-sy">;
Crayon-line Crayon-striped-line" id="Crayon-5c891cdf4bc99452016419-16">Crayon-h">Crayon-sy">}
Crayon-line" id="Crayon-5c891cdf4bc99452016419-17">Crayon-sy">}
Crayon-line Crayon-striped-line" id="Crayon-5c891cdf4bc99452016419-18">Crayon-e">add_actionCrayon-sy">(Crayon-h"> Crayon-s">'login_head'Crayon-sy">,Crayon-h"> Crayon-s">'change_login_form_username_password_label'Crayon-h"> Crayon-sy">)Crayon-sy">;

感兴趣的朋友可以测试一下。

原文链接:https://www.f2er.com/wordpress/238398.html

猜你在找的wordpress相关文章