正在檢視 4 個帖子:1-4 (共 4 個帖子)
-
作者帖子
-
我在網上找的程式碼可以隱藏郵箱輸入框,但不能取消沒填寫郵箱的錯誤,怎麼隱藏這個錯誤?
提前感謝回覆
你可以嘗試使用下面的程式碼,簡單講就是 JS 實現註冊無需郵件地址驗證。
add_action('user_profile_update_errors', 'my_user_profile_update_errors', 10, 3); function my_user_profile_update_errors($errors, $update, $user) { $errors->remove('empty_email'); } add_action('user_new_form', 'my_user_new_form', 10, 1); add_action('show_user_profile', 'my_user_new_form', 10, 1); add_action('edit_user_profile', 'my_user_new_form', 10, 1); function my_user_new_form($form_type) { ?> <script type="text/javascript"> jQuery('#email').closest('tr').removeClass('form-required').find('.description').remove(); <?php if (isset($form_type) && $form_type === 'add-new-user') : ?> jQuery ('#send_user_notification') .removeAttr('checked'); <?php endif; ?> </script> <?php }
是放到 functions.php 裡嗎?我看上去和之前一樣啊
看上去是一樣,只是不用輸入郵箱就可以註冊成功,新增位置沒錯。
-
作者帖子
正在檢視 4 個帖子:1-4 (共 4 個帖子)
- 哎呀,回覆話題必需登入。