function bp_get_total_group_count()
{
    return apply_filters('bp_get_total_group_count', groups_get_total_group_count());
}
/**
 * Return the total number of groups.
 *
 * @since 1.0.0
 *
 * @return type
 */
function bp_get_total_group_count()
{
    /**
     * Filters the total number of groups.
     *
     * @since 1.0.0
     *
     * @param int $value Total number of groups found.
     */
    return apply_filters('bp_get_total_group_count', groups_get_total_group_count());
}
Esempio n. 3
0
 /**
  * @group groups_get_total_group_count
  * @group counts
  */
 public function test_groups_get_total_group_count_should_respect_cached_value_of_0()
 {
     global $wpdb;
     // prime cache
     // no groups are created by default, so count is zero
     groups_get_total_group_count();
     $first_query_count = $wpdb->num_queries;
     // run function again
     groups_get_total_group_count();
     // check if function references cache or hits the DB by comparing query count
     $this->assertEquals($first_query_count, $wpdb->num_queries);
 }
Esempio n. 4
0
    <header class="group-header page-header">
        <div id="item-statistics" class="follows">
            <h1 class="main-title"><?php 
buddyboss_page_title();
?>
</h1>

            <span class="create-a-group"><?php 
echo bp_get_group_create_button();
?>
</span>

            <div class="numbers">
                <span>
                    <p><?php 
echo groups_get_total_group_count();
?>
</p>
                    <p><?php 
_e('Groups', 'boss');
?>
</p>
                </span>
            </div>
        </div><!-- #item-statistics -->
    </header><!-- .group-header -->

	<?php 
do_action('bp_before_directory_groups');
?>
 function add_fpe_meta_box($box, $event)
 {
     global $current_user;
     if (!function_exists('groups_get_groups')) {
         return $box;
     }
     $group_id = get_post_meta($event->get_id(), 'eab_event-bp-group_event', true);
     $group_count = defined('EAB_BP_GROUPS_LIST_GROUP_LIMIT') && intval(EAB_BP_GROUPS_LIST_GROUP_LIMIT) ? EAB_BP_GROUPS_LIST_GROUP_LIMIT : groups_get_total_group_count();
     $group_params = array('per_page' => $group_count, 'type' => 'alphabetical', 'show_hidden' => EAB_SHOW_HIDDEN_GROUP);
     if ($this->_data->get_option('bp-group_event-user_groups_only')) {
         if (!(is_super_admin() && $this->_data->get_option('bp-group_event-user_groups_only-unless_superadmin'))) {
             $group_params['user_id'] = $current_user->id;
         }
     }
     $groups = groups_get_groups($group_params);
     $groups = @$groups['groups'] ? $groups['groups'] : array();
     $ret .= '<div class="eab-events-fpe-meta_box">';
     $ret .= __('This is a group event for', Eab_EventsHub::TEXT_DOMAIN);
     $ret .= ' <select name="eab_event-bp-group_event" id="eab_event-bp-group_event">';
     $ret .= '<option value="">' . __('Not a group event', Eab_EventsHub::TEXT_DOMAIN) . '&nbsp;</option>';
     foreach ($groups as $group) {
         $selected = $group->id == $group_id ? 'selected="selected"' : '';
         $ret .= "<option value='{$group->id}' {$selected}>{$group->name}</option>";
     }
     $ret .= '</select> ';
     $ret .= '</div>';
     return $box . $ret;
 }
Esempio n. 6
0
</div>
<?php 
}
?>

<?php 
if ($tn_blogsmu_section_status == "enable" || $tn_blogsmu_section_status == "") {
    ?>

<div id="intro-content">
<div id="wrap-intro-content">

<?php 
    if ($bp_existed == 'true') {
        if ($tn_blogsmu_home_feat_groups == 'enable' || $tn_blogsmu_home_feat_groups == '') {
            if (groups_get_total_group_count() != '0') {
                locate_template(array('lib/templates/bp-template/random-groups.php'), true);
            }
        }
    }
    ?>

<div id="content-intro-content">

<div id="section1" class="services-box">
<?php 
    if ($tn_blogsmu_section_one_headline != "") {
        ?>
<h2><?php 
        if ($tn_blogsmu_section_one_headline == "") {
            _e("Section intro 1", TEMPLATE_DOMAIN);