[buddypress-trac] [BuddyPress Trac] #8277: iSSUE with BUDDYPRESS LOGIN WIDGET
buddypress-trac
noreply at wordpress.org
Thu Apr 16 06:31:19 UTC 2020
#8277: iSSUE with BUDDYPRESS LOGIN WIDGET
-----------------------------+-----------------------------
Reporter: giuseppecuttone | Owner: (none)
Type: defect (bug) | Status: new
Priority: high | Milestone: Awaiting Review
Component: Core | Version: 5.0.0
Severity: normal | Keywords:
-----------------------------+-----------------------------
Hi,
if I add in http://www.mysite.com/wp-login.php? some checkboxes about
TERMS OF USE, PRIVACY etc... the checkboxes I add will be showed well in
http://www.mysite.com/wp-login.php? but checkboxes will not be showed in
the BUDDYPRESS LOGIN WIDGET.
Code I am using is the follow:
(as you can see I am using hook provided by wordpress)
https://codex.wordpress.org/Customizing_the_Login_Form
{{{#!php
<?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>';
}}}
Can someone make the correspondent modification to BuddyPress code to have
running also my code into BuddyPress LogIn widget?
Thanks very very very very very very for your support.
--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/8277>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac
More information about the buddypress-trac
mailing list