Hello BuddyDev-Team,
1. I am just starting with Buddypress: I am puzzled about the theme. At the moment I have installed AVADA – Can I use the AVADA theme, it is one of the most used Word-Press-themes and I like it. Do I need to use a BuddyDev Theme?
– Since one of the last updates of buddypress, wordpress, or avada I noticed that the basic Pages of Buddypress like “activity” is no longer listed in the Page-list. Due to this I cannot edit the Startpage of Buddypress.2. The contact list displays the @username. This does not look like very nice and furthermore it can be of risk for security. How can I hide the username on the profile.
Best wishes
GiselaHi
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);
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
Thanks a lot for the prompt support. I’ll try it out.
Hi Tosin,
Thanks for your support – I’ve just tried to disable public message feature in buddypress settings. Dashboard > Settings > Buddypress > Options/Components but I could not find any option to disable public messages.
Thanks in advance
GiselaI’ve found the following Code in an other forum post:
‘add_filter( ‘bp_get_send_public_message_button’, ‘__return_empty_array’ );’
it works well und has disabled the public Message button in the list.
Best wishes
GiselaHi, thanks a lot for your help,
I’ve now hidden the public message button and the @username. That’s fine for me.
You must be logged in to reply to this topic.