On the members page the first card (member) shows is the current logged in user. Do you have aplugin that hides the card of the current logged in user? I dont see a reason to show the logged in users card in the member directory, why would they need to see themeslves?
Hi Steven,
Thank you for the question.
Please use the following code in your bp-custom.php
/** * Exclude Logged Users from BuddyPress Members List. * * @param array $args args. * * @return array */ function buddydev_exclude_logged_user( $args ) { // do not exclude if not logged in or in admin. if ( ! is_user_logged_in() || ( is_admin() && ! defined( 'DOING_AJAX' ) ) ) { return $args; } $excluded = isset( $args['exclude'] ) ? $args['exclude'] : array(); if ( ! is_array( $excluded ) ) { $excluded = explode( ',', $excluded ); } $excluded[] = get_current_user_id(); $args['exclude'] = $excluded; return $args; } add_filter( 'bp_after_has_members_parse_args', 'buddydev_exclude_logged_user' );
Regards
BrajeshHi Steven,
I am sorry for the inconvenience.Did you put it in your bp-custom.php.
if yes, did that file started with
<?php
tag.If possible, Please share the complete code from that file on pastebin.com and link me.
Regards
BrajeshI apologize, under further testing I miust have missind some of the syntax on the first go around. Ity works fine now. Thank you. 🙂
The topic ‘ [Resolved] Hide Logged In User Member Card’ is closed to new replies.