WordPress登录表单函数wp_login_form()没有设置占位符的参数,如果我想要添加placeholder占位符有什么好方法吗?
具体思路代码如下:
<?php /** * https://www.wp-diary.com * https://www.wpshequ.com */ $args = array( 'echo' => false, 'remember' => true, 'redirect' => ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], 'form_id' => 'mcl-loginform', 'id_username' => 'user_login', 'id_password' => 'user_pass', 'id_remember' => 'rememberme', 'id_submit' => 'wp-submit', 'label_username' => false, 'label_password' => false, 'label_remember' => __( 'Remember Me' ), 'label_log_in' => __( 'Log In' ), 'value_username' => '', 'value_remember' => false ); $form = wp_login_form($args ); //add the placeholders $form = str_replace('name="log"', 'name="log" placeholder="用户名/邮箱/手机号:"', $form); $form = str_replace('name="pwd"', 'name="pwd" placeholder="请输入密码:"', $form); echo $form; ?>
那么按照这个思路,WordPress的注册表单您也可以这样来添加placeholder
Remember Me Forgot Password
No Account? Register
Get Vcode
Agreed the《Service Agreement》
Account Login Forgot Password?
1 个回答
具体思路代码如下:
那么按照这个思路,WordPress的注册表单您也可以这样来添加placeholder