Shape the future of Social networking with WordPress: Join Project Midnight Sun! The next generation platform for community building with WordPress!

BuddyDev

Search

Replies

  • Participant
    Level: Guru
    Posts: 915

    Hello brajesh,

    Thank you very much your code worked perfectly, you are a life saver I’m really grateful for your help. I will also like to appreciate the good work you’re doing with buddypress. Your deep contribution has truly transformed buddypress from what it was 5 years ago.

    God bless you

  • Participant
    Level: Guru
    Posts: 915

    OK thanks so much i’m really grateful

  • Participant
    Level: Guru
    Posts: 915
    Tosin on in reply to: [Resolved] Force profile photo upload on a specific page #20704

    Hello,

    This code below is preventing the code you sent from working

     /**
     * Buddydev force follow 6 members function.
     */
    function buddydev_check_or_redirect() {
    	// Force profile photo active?
    	$fp_active = class_exists( 'BD_Force_User_Avatar_Helper' );
    
    	// skip if logged and on non bp page.
    	if ( is_user_logged_in() && ! is_buddypress() ) {
    		if ( $fp_active ) {
    			remove_action( 'bp_template_redirect', array(
    				BD_Force_User_Avatar_Helper::get_instance(),
    				'check_or_redirect',
    			), 1 );
    		}
    
    		return;
    	}
    
    	if ( ! function_exists( 'bp_follow_get_the_following_count' ) || ! is_user_logged_in() || is_super_admin() ) {
    		return;
    	}
    
    	$is_dir = bp_is_members_directory();
    
    	// if we are on directory and force profile is not active
    	// return.
    	if ( $is_dir && ! $fp_active ) {
    		return;
    	}
    
    	$follow_count = bp_follow_get_the_following_count( array( 'object_id' => get_current_user_id() ) );
    
    	if ( $follow_count >= 4 ) {
    		return;
    	}
    
    	if ( $is_dir && $fp_active ) {
    		remove_action( 'bp_template_redirect', array(
    			BD_Force_User_Avatar_Helper::get_instance(),
    			'check_or_redirect',
    		), 1 );
    
    		return;
    	}
    
    	bp_core_add_message( __( 'Please follow 4 or more members to continue.' ), 'error' );
    
    	bp_core_redirect( bp_get_members_directory_permalink() );
    }
    
    add_action( 'bp_template_redirect', 'buddydev_check_or_redirect', 0 ); 
  • Participant
    Level: Guru
    Posts: 915
    Tosin on in reply to: Buddypress blog activity notification #20640

    Any feedback sir, thanks

  • Participant
    Level: Guru
    Posts: 915

    Hello Brajesh,

    Any feedback on this issue

    Thank you

  • Participant
    Level: Guru
    Posts: 915

    Hello Brajesh,

    I am not reffering to a specific plugin, I don’t have any classified plugin installed, but im reffering to any custom post type that will be created, the earlier classified was just used as an example of a custom post type, it could be any custom post type. e.g reviews, books, cars etc

    Thanks

  • Participant
    Level: Guru
    Posts: 915

    Happy new year Brajesh,

    Thanks you so much for the snippet it worked perfectly.

    Thanks

  • Participant
    Level: Guru
    Posts: 915

    I want to skip for logged in users only. So logged in users can access the normal WordPress post and pages but the redirection should only be triggered on all buddypress pages.

    Thanks

  • Participant
    Level: Guru
    Posts: 915
    Tosin on in reply to: How to display custom notice on activity page #19683

    I am using BP legacy

  • Participant
    Level: Guru
    Posts: 915

    Will be expecting your feedback sir

    Thanks