BuddyDev

Search

Replies

  • Participant
    Level: Guru
    Posts: 900

    I using this filter to redirect users to force profile completion

     // filter buddypress profile completion redirect url to the (complete-profile) page.
    add_filter( 'buddypress_profile_completion_redirect', function ( $redirect_url ) {
    	return home_url( '/complete-profile/' );
    } ); 

    other codes im using are

     // Do not redirect users on user profile and activity directory pages. 
    function buddydev_skip_urls_on_loggedin_user_profile_and_activity_directory_page( $skip ) {
        if ( bp_is_my_profile() || bp_is_activity_directory() ) {
            $skip = true;
        }
        return $skip;
    }
    add_filter( 'bp_force_profile_completion_skip_check', 'buddydev_skip_urls_on_loggedin_user_profile_and_activity_directory_page' ); 
    
    // Redirect users on members directory pages. 
    function buddydev_skip_urls_on_members_directory( $skip ) {
        if ( bp_is_members_directory() ) {
            $skip = false;
        }
        return $skip;
    }
    add_filter( 'bp_force_profile_completion_skip_check', 'buddydev_skip_urls_on_members_directory' );
    
    // Do not redirect users on non bp pages.
    function buddydev_skip_redirect_on_non_bp_pages( $skip ) {
        if ( ! is_buddypress() ) {
            $skip = true;
        }
        return $skip;
    }
    add_filter( 'bp_force_profile_completion_skip_check', 'buddydev_skip_redirect_on_non_bp_pages' );
     
  • Participant
    Level: Guru
    Posts: 900

    I think there is misunderstanding from start.

    My intention is to change the default mystery man avatar based on member type

    I enabled the feature to associate custom avatar enabled in the (member types pro) plugin while the (buddypress profile completion) is enabled (user must have profile photo).

    THE PROBLEM
    Since the default mystery man avatar has been changed buddypress profile completion plugin is no longer forcing members to change their avatar

  • Participant
    Level: Guru
    Posts: 900

    Hello Ravi,

    Please note that this issue is not yet resolved, The custom member type photo is not displaying everywhere, it is only showing in the members directory its is not showing in activity and profile pages

    Thanks

  • Participant
    Level: Guru
    Posts: 900

    Thanks Ravi

    I hope this can be resolved soonest as new members on my site arent uploading new profile photos

    Regards

  • Participant
    Level: Guru
    Posts: 900

    Hello Ravi

    The code did not work, the code you provided removed the profile photos I set for the member types. I dont want the custom profile photos to be removed but I want the saved membertype profile photo to be compatible and work along side the buddypress profile completion plugin.

  • Participant
    Level: Guru
    Posts: 900

    Gentle reminder sir thanks

  • Participant
    Level: Guru
    Posts: 900
    Tosin on in reply to: Sticky Members in BuddyPress #51321

    I really love this idea and its also been on my mind for long now, since I didnt know if this was possible I just decided to stick with the buddypress featured members plugin.

    I would be awesome if there is an option to also make featured members sticky

  • Participant
    Level: Guru
    Posts: 900
    Tosin on in reply to: [Resolved] Getting started / hide the @username #51318

    Hi apologies for the confusion I meant (Disable
    Activity Streams) feature. The @username feature is enabled when the Activity Streams feature is enabled

  • Participant
    Level: Guru
    Posts: 900
    Tosin on in reply to: [Resolved] Getting started / hide the @username #51308

    There are various options depending if you want to partially diasable @mentions or completely disable it.

    1.

    add_filter( 'bp_activity_do_mentions', '__return_false' );

    2. Removes mentions pane from profile activity (doesn’t remove mention functionality)

    
     function remove_mention_nav() {
    global $bp;
    bp_core_remove_subnav_item( $bp->activity->slug, 'mentions' );
    }
    add_action( 'bp_setup_nav', 'remove_mention_nav', 15 ); 
    

    3.Just hide with css

    
     /* Hide username in BuddyPress profile header */
    #item-header .username {
        display: none;
    } 
    

    4. Just disable public message feature in buddypress settings

  • Participant
    Level: Guru
    Posts: 900
    Tosin on in reply to: [Resolved] Getting started / hide the @username #51305

    Hi

    Regarding the security issue I think you don’t need to hide the username, you can disable login by username and enable login by only email. Email addresses arent publicly displayed there by improving login security. I was able to achieve this with the code below.

     // Function to log in with email instead of username
    function use_email_for_login($user, $username, $password) {
        if (!empty($username) && !empty($password)) {
            // Check if the entered username is an email
            if (is_email($username)) {
                // Get the user by email
                $user = get_user_by('email', $username);
                if (!$user) {
                    // Email not found, return an error
                    return new WP_Error('invalid_email', __('Invalid email or password.'));
                } else {
                    // Authenticate the user with the retrieved username
                    $username = $user->user_login;
                    $user = wp_authenticate_username_password(null, $username, $password);
                    if (is_wp_error($user)) {
                        // Authentication failed, return an error
                        return new WP_Error('invalid_login', __('Invalid email or password.'));
                    }
                }
            } else {
                // If the entered username is not an email, return an error
                return new WP_Error('invalid_email_format', __('Invalid email or password.'));
            }
        }
        return $user;
    }
    add_filter('authenticate', 'use_email_for_login', 20, 3);