Replies
The plugin now works perfectly
1. How can I change the failed login error from (Password is Invalid!) to (Email or Password is Invalid!)
2. I have login disabled by username using the code above. When a user mistakenly tries to login with username instead of email this error message shows (Invalid Request) how can I change this to (Please login with valid email)
Kindly ignore above message the fault was mine I had this plugin enabled https://perfmatters.io/docs/change-wordpress-login-url/
login page can’t be accessed and logins are not successful keep getting the error
http://www.website.com redirected you too many times.
Try clearing your cookies.
ERR_TOO_MANY_REDIRECTSThis error occurs without activating limit login attempts plugin
Please note that I have this code in my functions.php
/** * Email login support for bp-branded-login plugin */ add_filter( 'wp_authenticate_user', function( $user ) { if ( isset( $_POST['log'] ) && ! is_email( trim( $_POST['log'] ) ) ) { return new WP_Error( 'invalid_email', __( 'Please provide a valid email' ) ); } return $user; }, 10 );
Thanks for the feedback what do you think about this plugin https://wordpress.org/plugins/docket-cache/ with buddypress.
- Tosin on January 29, 2021 at 7:04 am in reply to: [Resolved] Display followers tab in members directory #35904
Hello Ravi,
Problem solved using the priority number 20
function bpfollow_add_followers_tab() { if ( ! is_user_logged_in() ) { return; } $count = bp_follow_get_the_followers_count(); if ( empty( $count ) ) { return; } ?> <li id="members-followers"><a href="<?php echo bp_loggedin_user_domain() . BP_FOLLOWERS_SLUG ?>"><?php printf( __( 'My Followers <span>%d</span>', 'buddypress-followers' ), esc_html( $count ) ) ?></a></li> <?php } add_action( 'bp_members_directory_member_types', 'bpfollow_add_followers_tab', 20 );
- Tosin on January 28, 2021 at 10:54 am in reply to: [Resolved] Display followers tab in members directory #35871
I am using legacy template
- Tosin on January 28, 2021 at 10:01 am in reply to: [Resolved] Display followers tab in members directory #35864
It did not work
function bpfollow_add_followers_tab() { if ( ! is_user_logged_in() ) { return; } $count = bp_follow_get_the_followers_count(); if ( empty( $count ) ) { return; } ?> <li id="members-followers"><a href="<?php echo bp_loggedin_user_domain() . BP_FOLLOWERS_SLUG ?>"><?php printf( __( 'My Followers <span>%d</span>', 'buddypress-followers' ), esc_html( $count ) ) ?></a></li> <?php } add_action( 'bp_members_directory_member_types', 'bpfollow_add_followers_tab', 999 );
- Tosin on January 28, 2021 at 9:39 am in reply to: [Resolved] Display followers tab in members directory #35860
But now how can I change the menu position for this code, My total menu items is 7, I want the (My Followers) tab to be positioned last
- This reply was modified 4 years, 5 months ago by
Tosin.
- This reply was modified 4 years, 5 months ago by
- Tosin on January 28, 2021 at 9:20 am in reply to: [Resolved] Display followers tab in members directory #35859
Yeah I finally got it, thanks for making me brainstrom
/** * Add a "Followers (X)" tab to the members directory. * * This is so the logged-in user can filter the members directory to only * users that the current user is following. * * @uses bp_follow_total_follow_counts() Get the following/followers counts for a user. */ function bpfollow_add_followers_tab() { if ( ! is_user_logged_in() ) { return; } $count = bp_follow_get_the_followers_count(); if ( empty( $count ) ) { return; } ?> <li id="members-followers"><a href="<?php echo bp_loggedin_user_domain() . BP_FOLLOWERS_SLUG ?>"><?php printf( __( 'My Followers <span>%d</span>', 'buddypress-followers' ), esc_html( $count ) ) ?></a></li> <?php } add_action( 'bp_members_directory_member_types', 'bpfollow_add_followers_tab' );
- Tosin on January 28, 2021 at 9:04 am in reply to: [Resolved] Display followers tab in members directory #35857
I added the code below to my bp-custom.php file but my site crashed
/** * Add a "Following (X)" tab to the members directory. * * This is so the logged-in user can filter the members directory to only * users that the current user is following. * * @uses bp_follow_total_follow_counts() Get the following/followers counts for a user. */ function bp_follow_add_following_tab() { if ( ! is_user_logged_in() ) { return; } $count = bp_follow_get_the_following_count(); if ( empty( $count ) ) { return; } ?> <li id="members-following"><a href="<?php echo bp_loggedin_user_domain() . BP_FOLLOWING_SLUG ?>"><?php printf( __( 'Following <span>%d</span>', 'buddypress-followers' ), esc_html( $count ) ) ?></a></li> <?php } add_action( 'bp_members_directory_member_types', 'bp_follow_add_following_tab' );