W3cubDocs

/WordPress

get_current_blog_id(): int

Retrieves the current site ID.

Return

int Site ID.

Source

function get_current_blog_id() {
	global $blog_id;

	return absint( $blog_id );
}

Changelog

Version Description
3.1.0 Introduced.

© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/get_current_blog_id