get_current_blog_id

Retrieve the current site ID.

Description

(int) get_current_blog_id(); 

Returns (int)

Site ID.


Usage

  1. if ( !function_exists( 'get_current_blog_id' ) ) { 
  2. require_once ABSPATH . WPINC . '/load.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = get_current_blog_id(); 
  7.  

Defined (1)

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

/wp-includes/load.php  
  1. function get_current_blog_id() { 
  2. global $blog_id; 
  3. return absint($blog_id);