How to remove bp_member_latest_update from the member’s page
-
Hello,
I would like to modify the default Member’s page to remove the “bp_member_latest_update”. Currently the page shows the list of members, not including the “Admins”. I achieved this by adding the following function to the functions.php page:
add_filter( 'bp_after_has_members_parse_args', 'buddydev_exclude_users_by_role' ); function buddydev_exclude_users_by_role( $args ) { //do not exclude in admin if( is_admin() && ! defined( 'DOING_AJAX' ) ) { return $args; } $excluded = isset( $args['exclude'] )? $args['exclude'] : array(); if( !is_array( $excluded ) ) { $excluded = explode(',', $excluded ); } $role = 'administrator';//change to the role to be excluded $user_ids = get_users( array( 'role' => $role ,'fields'=>'ID') ); $excluded = array_merge( $excluded, $user_ids ); $args['exclude'] = $excluded; return $args; }
The page shows the default behavior: Avatar, Name, Latest Activity (with a link that reads “view”), and the last active time.
I would like to remove/hide the latest activity (including the word “view”) from the list altogether. Any ideas on how I could achieve this? Perhaps with a snippet to add to the functions.php file?
I have the following installed:
BuddyPress – 2.9.1
WordPress – 4.8.2
Theme – Buddy (child)I appreciate any help in advance!
- You must be logged in to reply to this topic.