BuddyDev

Search

Replies

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115

    Hello Lisa,

    Thank you for the acknowledgement. I am glad that I could help.

    Regards
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115

    Hello Tosin,

    Try the following.

    
    /**
     * BuddyPress Auto Friendship Pro + BuddyPress Featured Members autofollow.
     */
    add_action( 'wp_login', function ( $user_login, $user ) {
    
    	if ( ! function_exists( 'bp_follow_start_following' ) ) {
    		return;
    	}
    
    	if ( empty( bp_get_user_last_activity( $user->ID ) ) ) {
    		$featured_user_ids = get_users(
    			array(
    				'meta_key' => '_is_featured',
    				'fields'   => 'ID',
    				'number'   => - 1,
    			)
    		);
    
    		if ( empty( $featured_user_ids ) ) {
    			return;
    		}
    
    		foreach ( $featured_user_ids as $featured_user_id ) {
    			bp_follow_start_following( array(
    				'leader_id'   => $featured_user_id,
    				'follower_id' => $user->ID,
    			) );
    		}
    	}
    }, -5, 2 );
    
    

    Regards
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115

    Hello Masuk,

    I have not done anything except deactivate and activate two plugins again. Please recheck it and let me know if it is working fine or not.

    Regards
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115

    Hi Masuk,

    I have tested it on your site and it does not seem to be working.
    Do you have a staging site where I can disable some of the plugins and check it again?

    Thank you
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115

    Hello Masuk,

    Thank you for the details. I will check and will update you by day end.

    Regards
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115

    Hello Masuk,

    Please upgrade the plugin. We have added support for the EDD plugin. Please check.

    https://buddydev.com/plugins/wordpress-restrict-email-domains/

    Regards
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115

    Hello Lisa,

    Try the following code and let me know it helps or not

    
    /**
     * Make a BuddyPress section of the site Private.
     *
     * @author sbrajesh
     * @global string $pagenow
     */
    function buddydev_private_site() {
    
    	// do not restrict logged in users.
    	if ( is_user_logged_in() ) {
    		return;
    	}
    
    	// handle Special case of BuddyPress registration/Login.
    	if ( function_exists( 'is_buddypress' ) && is_buddypress() ) {
    
    		$skip = false;
    
    		if ( bp_is_activation_page() || bp_is_register_page() ) {
    			$skip = true;
    		} elseif ( function_exists( 'bp_branded_login' ) ) {
    			$skip = bl_is_bl_pages();
    		}
    
    		if ( $skip ) {
    			return;
    		}
    
    		$redirect_url = wp_login_url( site_url( '/' ) ); // get login url.
    
    		wp_safe_redirect( $redirect_url );
    		exit( 0 );
    	}
    }
    
    add_action( 'template_redirect', 'buddydev_private_site', 0 );
    
    

    Regards
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on in reply to: [Resolved] I need a plugin or shortcode for… #45743

    Hello Hans,

    Try the following code:

    
    add_filter( 'buddypress_profile_completion_has_uploaded_avatar', function ( $has_uploaded, $user_id ) {
    
    	if ( $has_uploaded || ! function_exists( 'oa_social_login_activate' ) ) {
    		return $has_uploaded;
    	}
    
    	$user_meta_thumbnail = get_user_meta( $user_id, 'oa_social_login_user_thumbnail', true );
    	$user_meta_picture   = get_user_meta( $user_id, 'oa_social_login_user_picture', true );
    
    	if ( $user_meta_picture || $user_meta_thumbnail ) {
    		$has_uploaded = true;
    	}
    
    	return $has_uploaded;
    }, 10, 2 );
    
    

    Please let me know if it works or not

    Regards
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on in reply to: Mediapress and categories #45742

    Hello Edman,

    Welcome to the BuddyDev Forums. There is one plugin for applying categories on MediaPress Galleries and the same categories will be set on media as of gallery. You can list them on the galleries directory page.

    Download for given URL:
    https://github.com/mediapress/mpp-gallery-categories/archive/refs/heads/master.zip

    Please give it a try.

    Regards
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115

    Hello Tosin,

    Thank you for the acknowledgement. We will welcome your feedback.

    Regards
    Ravi

    • This reply was modified 2 years, 6 months ago by Ravi.