Created
October 30, 2018 20:44
-
-
Save KaineLabs/0a0874661e70ddc743334473f751ec6b to your computer and use it in GitHub Desktop.
Remove Hidden Group From Total Count
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Remove Hidden Group From Total Count. | |
*/ | |
function yzc_edit_group_total_count( $count ) { | |
global $wpdb; | |
$bp = buddypress(); | |
return $wpdb->get_var( "SELECT COUNT(id) FROM {$bp->groups->table_name} WHERE status != 'hidden' " ); | |
} | |
add_filter( 'bp_get_total_group_count' ,'yzc_edit_group_total_count' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment