How to implement this with your customized form
You need to render the checkboxes and then save its contents right after the user has been saved to the database.
To render the checkboxes you can use
When you save the user to the database using your custom logic, you can call
GDPR::save_user_consent_on_registration( $user_id ) to automatically save the consent to the database and log this information to the audit log.
Important: This function must be called after the user has been saved to the database and assigned a user ID to it.
You can read more about these and other functions here: Functions & Shortcodes
<form method="post"> <label for="first_name">First Name</label> <input type="text" name="first_name" id="first_name" value="" placeholder=""> <label for="last_name">Last Name</label> <input type="text" name="last_name" id="last_name" value="" placeholder=""> <label for="email">E-mail</label> <input type="email" name="email" id="email" value="" placeholder=""> <label for="password">Password</label> <input type="password" name="password" id="password" value="" placeholder=""> <?php GDPR::consent_checkboxes(); ?> <input type="submit" name="" value="Register"> </form>
// Your custom code and validations. Everything else in your registration logic. $userdata = array( 'user_login' => 'login_name', 'user_pass' => NULL, // When creating a user, `user_pass` is expected. // more fields. You can learn more at https://codex.wordpress.org/Function_Reference/wp_insert_user ); $new_user = wp_insert_user( $userdata ); GDPR::save_user_consent_on_registration( $new_user );