php - How to enforce the user to click a checkbox in profile section in Buddypress -
i'm developping website using wordpress & buddypress. aim display checkbox in profile page consist in accepting "term of use". point ok. enforce user thick checkbox, otherwise can leave page (or validate changes). alternative "obligatory" of "required filed" in wp-admin section (users > profile configuration) not efficient.
do have suggestion, or advice give ?
thank
how want enforce this? if fellow member must agree terms no matter what, simple redirect profile page if terms yet agreed
function redirect_to_terms() { if ( is_user_logged_in() && $terms_not_agreed ) { bp_core_add_message( 'you must agree our terms', 'error' ); wp_redirect( '/members/' . bp_core_get_username( bp_loggedin_user_id() ) ); exit(); } } add_action( 'template_redirect', 'redirect_to_terms' );
note: you'll need assign either true
or false
$terms_not_agreed
before in code.
php wordpress checkbox buddypress
No comments:
Post a Comment