admin管理员组

文章数量:1391995

good day, my registration form has some custom fields, basically I want to approve the user if and only if some fields are filled with some specific values, if they're not, then these accounts must be manually approved

do you know some hook and code that I can use for this purpose?...thank you so much

good day, my registration form has some custom fields, basically I want to approve the user if and only if some fields are filled with some specific values, if they're not, then these accounts must be manually approved

do you know some hook and code that I can use for this purpose?...thank you so much

Share Improve this question asked Mar 12, 2020 at 20:04 clagccsclagccs 1033 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 1
 ## Try this if you are using Woocommerce   

    function ws_new_user_approve_registration_message(){
                $not_approved_message = '<p class="registration">Send in your registration application today!<br /> NOTE: Your account will be held for moderation and you will be unable to login until it is approved.</p>';

                if( isset($_REQUEST['approved']) ){
                        $approved = $_REQUEST['approved'];
                        if ($approved == 'false')  echo '<p class="registration successful">Registration successful! You will be notified upon approval of your account.</p>';
                        else echo $not_approved_message;
                }
                else echo $not_approved_message;
        }
        add_action('woocommerce_before_customer_login_form', 'ws_new_user_approve_registration_message', 2);

本文标签: hooks for automatic approve user registration according to data in custom fields