Skip to content

Instantly share code, notes, and snippets.

@KaineLabs
Created October 30, 2018 20:44
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KaineLabs/0a0874661e70ddc743334473f751ec6b to your computer and use it in GitHub Desktop.
Save KaineLabs/0a0874661e70ddc743334473f751ec6b to your computer and use it in GitHub Desktop.
Remove Hidden Group From Total Count
<?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