Viewing 1 replies (of 1 total)
  • Thread Starter giuseppecuttone

    (@giuseppecuttone)

    Hi,
    I have also tested your plugin with my own code in the function.php but also in this case your plugin is not able to show the checkbox I have added with y code.

    Follow the code I have used.

    Can you have a look to that and let me know if you can add to your plugin the correct modification to ressolve that?
    Take in your mind that checkboxes for term and us are needed to acomplish with privacy legislation. They are very important to show… I am sure you understant ??

    
    <?php
    
    // As part of WP authentication process, call our function
    add_filter('wp_authenticate_user', 'wp_authenticate_user_acc', 99999, 2);
    
    function wp_authenticate_user_acc($user, $password) {
        // See if the checkbox #login_accept was checked
        if ( isset( $_REQUEST['login_accept'] ) && $_REQUEST['login_accept'] == 'on' ) {
            // Checkbox on, allow login
            return $user;
        } else {
            // Did NOT check the box, do not allow login
            $error = new WP_Error();
            $error->add('did_not_accept', 'You must accept the terms and conditions' );
            return $error;
        }
    }
    
    // As part of WP login form construction, call our function
    add_filter ( 'login_form', 'login_form_acc' );
    
    function login_form_acc(){
        // Add an element to the login form, which must be checked
        echo '<label><input type="checkbox" name="login_accept" id="login_accept" /> I agree</label>';
    }
    ?>
    
Viewing 1 replies (of 1 total)
  • The topic ‘Dont import external checkboxes’ is closed to new replies.