BuddyDev

Search

Replies

  • Participant
    Level: Guru
    Posts: 910
    Tosin on in reply to: Limit login for branded login plugin #35989

    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)

  • Participant
    Level: Guru
    Posts: 910
    Tosin on in reply to: Limit login for branded login plugin #35988

    Kindly ignore above message the fault was mine I had this plugin enabled https://perfmatters.io/docs/change-wordpress-login-url/

  • Participant
    Level: Guru
    Posts: 910
    Tosin on in reply to: Limit login for branded login plugin #35987

    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_REDIRECTS

    This 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 ); 
    
  • Participant
    Level: Guru
    Posts: 910
    Tosin on in reply to: Caching admin-ajax.php and buddypress #35973

    Thanks for the feedback what do you think about this plugin https://wordpress.org/plugins/docket-cache/ with buddypress.

  • Participant
    Level: Guru
    Posts: 910
    Tosin on 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 ); 
  • Participant
    Level: Guru
    Posts: 910
    Tosin on in reply to: [Resolved] Display followers tab in members directory #35871

    I am using legacy template

  • Participant
    Level: Guru
    Posts: 910
    Tosin on 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 ); 
  • Participant
    Level: Guru
    Posts: 910
    Tosin on 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.
  • Participant
    Level: Guru
    Posts: 910
    Tosin on 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' ); 
  • Participant
    Level: Guru
    Posts: 910
    Tosin on 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' );