WordPress.org

Ready to get started?Download WordPress

Codex

Function Reference/get current blog id

Contents

Description

Retrieve the current blog id.

Usage

<?php get_current_blog_id() ?>

Parameters

None.

Return Values

(integer) 
Blog id

Examples

$blog_id = get_current_blog_id();

Notes

  • Uses global: (integer) $blog_id The Blog ID.

Change Log

Since: 3.1.0

In 3.4, moved from /wp-includes/general-template.php to /wp-includes/load.php

Source File

get_current_blog_id() is located in /wp-includes/load.php.

Related

switch_to_blog(), ms_is_switched(), restore_current_blog(), get_current_blog_id(), wp_get_sites(), get_blog_details()

See also index of Function Reference and index of Template Tags.