WordPress at a glance

get_current_blog_id() WP 1.0

Retrieve the current site ID.

  • Global. Int. $blog_id
Is the basis for: is_main_site()
✈ 1 time = 0.000018s = very fast | 50000 times = 0.01s = speed of light PHP 7.1.2, WP 4.7.5

No Hooks.

Return

Int. Site ID.

Usage

get_current_blog_id();

Code of get_current_blog_id: wp-includes/load.php VER 5.0

<?php
function get_current_blog_id() {
	global $blog_id;
	return absint($blog_id);
}

Related Functions

From category: Multisite

More from Template Tags: Main Functions

No comments
    Hello, !     Log In . Register