如何仅使用OTP使用电话号码注册和登录用户Woocommerce

时间:2019-09-01 16:58:00

标签: php wordpress woocommerce

我正在尝试仅通过OTP注册和登录用户。用户将验证他的电话号码,它将直接登录他。

我找不到任何适合Woocommerce登录过程的解决方案,并尝试禁用wordpress的电子邮件,但这没有帮助。您能指导我完成我的目标吗?预先感谢。

// This will suppress empty email errors when submitting the user form

   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');

}



// This will remove javascript required validation for email input

// It will also remove the '(required)' text in the label

// Works for new user, user profile and edit user forms

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();

        // Uncheck send new user email option by default

        <?php if (isset($form_type) && $form_type === 'add-new-user') : ?>

            jQuery('#send_user_notification').removeAttr('checked');

        <?php endif; ?>

    </script>

    <?php

}

我试图禁用Wordpress和Woocommerce的电子邮件注册,并且仅使用电话号码进行注册。但这没用。

0 个答案:

没有答案
相关问题