Forum Replies Created
-
??
any reply?
Can you help me little more?
how I used that filter to remove denied user to mention, denied status is saved in usermeta.I am some code snippet getting users whose role is subscriber and status is denied/pending to exclude from members directory, members count
$role = ‘subscriber’;// change to the role to be excluded.
$user_ids = get_users(array( ‘role’ => $role, ‘fields’ => ‘ID’, ‘meta_query’ => array(‘relation’ => ‘OR’, array(‘key’ => ‘pw_user_status’, ‘value’ => ‘pending’), array(‘key’ => ‘pw_user_status’, ‘value’ => ‘denied’)) ) );
Is that way I used above filter?
any help??
Hi,
I am using memberpress plugin for members login/profile with buddypress. And I am using New User approved plugin to approve members. So there are a number of denied users/members, which I don’t want to see in tagging option, as I described above.
I write in same way, as you send above in function file. But nothing worked.
Hi,
I added the code to exclude denied and pending users from member directory, listing and forum count. It works fine 2 days before. But now it’s not.
Total memebers are 122 but it shows 119. Even I run the repair tool.
Here is my code
///// Remove pending/denied users from the member directory////////
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 = ‘subscriber’;// change to the role to be excluded.
$user_ids = get_users(array( ‘role’ => $role, ‘fields’ => ‘ID’, ‘meta_query’ => array(‘relation’ => ‘OR’, array(‘key’ => ‘pw_user_status’, ‘value’ => ‘pending’), array(‘key’ => ‘pw_user_status’, ‘value’ => ‘denied’)) ) );$excluded = array_merge( $excluded, $user_ids );
$args[‘exclude’] = $excluded;return $args;
}/********** Excluded ADmin and pending/denied users from members listing page ***************/
function exclude_total_users($count){$role = ‘subscriber’;// change to the role to be excluded.
$user_ids = get_users(array( ‘role’ => $role, ‘fields’ => ‘ID’, ‘meta_query’ => array(‘relation’ => ‘OR’, array(‘key’ => ‘pw_user_status’, ‘value’ => ‘pending’), array(‘key’ => ‘pw_user_status’, ‘value’ => ‘denied’)) ) );$user_excluded = count($user_ids);
return ($count – $user_excluded – 1);
}
add_filter(‘bp_get_total_member_count’,’exclude_total_users’);/******* Exclude pending/denied and admin users from forum stats ***********/
function exclude_users_forum($user_count){
$role = ‘subscriber’;// change to the role to be excluded.
$user_ids = get_users(array( ‘role’ => $role, ‘fields’ => ‘ID’, ‘meta_query’ => array(‘relation’ => ‘OR’, array(‘key’ => ‘pw_user_status’, ‘value’ => ‘pending’), array(‘key’ => ‘pw_user_status’, ‘value’ => ‘denied’)) ) );$user_excluded = count($user_ids);
return ($user_count – $user_excluded – 1);
}
add_filter(‘bbp_get_total_users’,’exclude_users_forum’);
/*******************/Can you help me to sort it out, what is the issue??
Thanks in advance.
Thanks for the suggestion. I will try it soon.
That was not fixed with custom code. Custom code fixes “Viewing 1 to 20 of 46 active members”, not the main counts https://www.screencast.com/t/JR7qDZTkDL9D
Everytime I need to go back to admin section, tools -> buddypress.
Thanks for reply.
I used custom code to achieve my goal. And it’s all working fine now.
any solution??
Hi,
Can you let me know,
1. For which I need to disable email, memberpress or something else?
2. how I disable activation email?
3. how I activate them manually?Hi,
For members count on member listing page, every time I need to go back to admin and follow the above steps to show the current users counts.
Is there a way it will automatically update the counts on members listing page?
Thanks
Yes, I am using “New User approve” plugin, as I am using “Memberpress” plugin to maintain registrations.
How I approve new users from buddypress?
Wow! it worked.
Thanks for your help.
Thanks for your help. It worked.
Hi,
I used “current_user_can” function, but Forum form is not displaying for moderators.
How I check my theme or plugin conflict with that?
I didn’t modified any template or file from Buddypress. I am using Divi theme and memberPress plugin for maintaining the members. Also used “MemberPress + BuddyPress Integration” plugin to integrates MemberPress with BuddyPress.
Is any one from above creating issue for tabs?