WordPress at Your Fingertips

get_current_blog_id() WP 1.0

Retrieve the current site ID.

Used By: is_main_site()
1 time — 0.000018 sec (very fast) | 50000 times — 0.01 sec (speed of light) | PHP 7.1.2, WP 4.7.5

No Hooks.

Return

Int. Site ID.

Usage

get_current_blog_id();

Notes

  • Global. Int. $blog_id

Changelog

Since 3.1.0 Introduced.

Code of get_current_blog_id() WP 5.8

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

From category: Multisite

More from Template Tags: Main Functions

No comments
    Log In