function bp_get_total_blog_count() { return apply_filters( 'bp_get_total_blog_count', bp_blogs_total_blogs() ); }
/** * Return the total number of blogs on the site. * * @return int Total number of blogs. */ function bp_get_total_blog_count() { /** * Filters the total number of blogs on the site. * * @since BuddyPress (1.2.0) * * @param int $value Total number of blogs on the site. */ return apply_filters('bp_get_total_blog_count', bp_blogs_total_blogs()); }
/** * @group bp_blogs_total_blogs */ public function test_bp_blogs_total_blogs_count_after_delete_blog() { if (!is_multisite()) { return; } $u = $this->factory->user->create(); // need to make sure we set the 'public' flag due to how BP_Blogs_Blogs:get_all() works $b1 = $this->factory->blog->create(array('meta' => array('public' => 1))); $b2 = $this->factory->blog->create(array('meta' => array('public' => 1))); bp_blogs_record_blog($b1, $u); bp_blogs_record_blog($b2, $u); // prime total blog count bp_blogs_total_blogs(); // delete a blog wpmu_delete_blog($b2); $this->assertEquals(1, bp_blogs_total_blogs()); }