Tagged: directory count all members
Using BuddyPress Member Types Pro I include in directory only some Member type.
I also exclude some role using BP Custom Functionalities https://fr.wordpress.org/plugins/bp-custom-functionalities/
To avoid onflict with , I deactivated BP Custom Functionalities
In member directory, count of “All members” displays number of all members in database not number of all members in directory
Is it the way it should work ?
I would like to have numbers of “All member” in directory not all members in database
Is there a way to get this ?
Thank you for reporting. I am aware of the issue.
The counts in BuddyPress do not behave correctly as they do not take into consideration the current query. They only take consideration of the global state.
There is a solution but these are not efficient, that’s why I haven’t included it in the plugin..
I will share the code to help fix it.
Thank you for the patience.
Please put this code in your bp-custom.php
and then visit dashboard->Tools->BuddyPress and check ” Repair total members count.”
and then click on Repair items. That will take care of it.
It works !
The count of total member is also right when a user is deactviated but the count ot member types is wrong when a user is deactviated
Is it something you can fix in this code or is it related to an other code in Member Type pro ?
Currently, to optimize the query, we do not count member types based on users. We are using the term count(member types is a taxonomy) to fetch all count in one query. The down side is it does not keep track if a user got deactivated or is active currently.
The other solution is to count for each member type on page load. I am not in favour of it as it will be too may db queries.
I am going to solve it in the Member Types Pro code. Will need 3-4 days to provide the plugin update.
You must be logged in to reply to this topic.