BuddyDev

Search

Replies

  • Participant
    Level: Guru
    Posts: 902
    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: 902
    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); 
  • Participant
    Level: Guru
    Posts: 902

    Thank you Ravi,

    This code below worked for me

     function custom_modify_visibility_levels($allowed_visibilities) {
        // Add a new visibility level for 'My Followers'
        if (function_exists('bp_follow_is_following')) {
            $allowed_visibilities['followers'] = array(
                'id'    => 'followers',
                'label' => __('My Followers', 'buddypress')
            );
        }
    
        return $allowed_visibilities;
    }
    add_filter('bp_xprofile_get_visibility_levels', 'custom_modify_visibility_levels');
    
    // Adjust visibility based on followers
    function custom_get_hidden_visibility_types_for_user($hidden_levels, $displayed_user_id, $current_user_id) {
        if ($displayed_user_id != $current_user_id && !bp_follow_is_following(array('leader_id' => $displayed_user_id, 'follower_id' => $current_user_id)) && !is_super_admin()) {
            $hidden_levels[] = 'followers'; // Hide profile field with 'My Followers' visibility level for the user
        }
        return $hidden_levels;
    }
    add_filter('bp_xprofile_get_hidden_field_types_for_user', 'custom_get_hidden_visibility_types_for_user', 10, 3); 
  • Participant
    Level: Guru
    Posts: 902

    Thanks Ravi

    The code worked perfectly

  • Participant
    Level: Guru
    Posts: 902
    Tosin on in reply to: [Resolved] Buddyblog pro and buddypress 12.0.0 beta 1 #51214

    This is now resolved it was a caching issue

    Thanks

  • Participant
    Level: Guru
    Posts: 902
    Tosin on in reply to: [Resolved] Buddyblog pro and buddypress 12.0.0 beta 1 #51198

    Hi Brajesh,

    I have version 1.4.0 but no new update is available, your changelog at https://buddydev.com/plugins/buddyblog-pro/ says 1.4.0 support bp 12.0.0, i have tested it and Blog tab is not displaying in the user navigation menu

  • Participant
    Level: Guru
    Posts: 902
    Tosin on in reply to: Branded login and buddypress 12.0.0 beta 1 #51132
    This reply has been marked as private.
  • Participant
    Level: Guru
    Posts: 902
    Tosin on in reply to: Branded login and buddypress 12.0.0 beta 1 #51115

    Hi Brajesh,

    This is really heart breaking to know that you are deprecating this awesome plugin, Branded Login has been my number one plugin for buddypress simply because I so much dislike the default wordpress login page, all other alternative plugins to customize the default login pages are just terrible and bloated also using security plugins to change the login url from (wp-login.php) to (login) is also terrible,

    There is not an alternative to your plugin, I would really appreciate your guidance on how you designed your login page for buddydev which looks flawless with your theme’s design.

    Thanks

  • Participant
    Level: Guru
    Posts: 902
    Tosin on in reply to: [Resolved] Buddyblog pro and buddypress 12.0.0 beta 1 #51086

    Gentle reminder sir

    BuddyPress 12.0.0 is now available

  • Participant
    Level: Guru
    Posts: 902
    Tosin on in reply to: Branded login and buddypress 12.0.0 beta 1 #51085

    Gentle reminder sir

    BuddyPress 12.0.0 is now available