bp_blogs_total_blogs

Get the total number of blogs being tracked by BuddyPress.

Description

(int) bp_blogs_total_blogs(); 

Returns (int)

$count Total blog count.


Usage

  1. if ( !function_exists( 'bp_blogs_total_blogs' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-blogs/bp-blogs-functions.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = bp_blogs_total_blogs(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/bp-blogs/bp-blogs-functions.php  
  1. function bp_blogs_total_blogs() { 
  2. $count = wp_cache_get( 'bp_total_blogs', 'bp' ); 
  3.  
  4. if ( false === $count ) { 
  5. $blogs = BP_Blogs_Blog::get_all(); 
  6. $count = $blogs['total']; 
  7. wp_cache_set( 'bp_total_blogs', $count, 'bp' ); 
  8. return $count;