get_current_blog_id(): int
- Since
- 3.1.0
- Source
wp-includes/load.php:1481
Retrieves the current site ID.
Return
int- Site ID.
Uses · 1
- absint()Converts a value to non-negative integer.
Used by · 50
- WP_Admin_Bar::initialize()Initializes the admin bar.
- WP_Customize_Nav_Menu_Item_Setting::preview()Handle previewing the setting.
- WP_Customize_Nav_Menu_Item_Setting::value()Get the instance data for a given nav_menu_item setting.
- WP_Customize_Nav_Menu_Setting::filter_nav_menu_options()Filters the nav_menu_options option to include this menu's auto_add preference.
- WP_Customize_Nav_Menu_Setting::filter_wp_get_nav_menu_object()Filters the wp_get_nav_menu_object() result to supply the previewed menu object.
- WP_Customize_Nav_Menu_Setting::filter_wp_get_nav_menus()Filters the wp_get_nav_menus() result to ensure the inserted menu object is included, and the deleted one is removed.
- WP_Customize_Nav_Menu_Setting::preview()Handle previewing the setting.
- WP_Customize_Nav_Menu_Setting::value()Get the instance data for a given widget setting.
- WP_Customize_Setting::is_current_blog_previewed()Return true if the current site is not the same as the previewed site.
- WP_Customize_Setting::preview()Add filters to supply the setting's value when accessed.
- WP_Debug_Data::get_wp_core()Gets the WordPress core section of the debug data.
- WP_Object_Cache::__construct()Sets up object properties.
Show all 50
- WP_Roles::for_site()Sets the site to operate on. Defaults to the current site.
- WP_Roles::get_roles_data()Gets the available roles data.
- WP_Theme::get_allowed_on_site()Returns array of stylesheet names of themes allowed on the site.
- WP_Themes_List_Table::no_items()
- WP_User::for_site()Sets the site to operate on. Defaults to the current site.
- WP_User::get_role_caps()Retrieves all of the capabilities of the user's roles, and merges them with individual user capabilities.
- WP_User_Query::fill_query_vars()Fills in missing query variables with default values.
- WP_User_Query::get_cache_last_changed()Retrieves the last changed cache timestamp for users and optionally posts.
- _access_denied_splash()Displays an access denied message when a user tries to view a site's dashboard they do not have access to.
- _wp_upload_dir()A non-filtered, non-cached version of wp_upload_dir() that doesn't check the path.
- add_blog_option()Adds a new option for a given blog ID.
- add_existing_user_to_blog()Adds a user to a blog based on details from maybe_add_existing_user_to_blog().
- clean_site_details_cache()Cleans the site details cache for a site.
- count_users()Counts number of users who have each of the user roles.
- delete_blog_option()Removes an option by name for a given blog ID. Prevents removal of protected WordPress options.
- get_active_blog_for_user()Gets one of a user's active blogs.
- get_blog_details()Retrieves the details for a blog from the blogs table and blog options.
- get_blog_option()Retrieves option value for a given blog id based on name of option.
- get_blogs_of_user()Gets the sites a user belongs to.
- get_custom_logo()Returns a custom logo, linked to home unless the theme supports removing the link on the home page.
- get_dashboard_url()Retrieves the URL to the user's dashboard.
- get_main_site_id()Gets the main site ID.
- get_oembed_response_data_for_url()Retrieves the oEmbed response data for a given URL.
- get_site()Retrieves site data given a site ID or site object.
- get_site_icon_url()Returns the Site Icon URL.
- get_users_of_blog()Get users for the site.
- has_custom_logo()Determines whether the site has a custom logo.
- is_main_site()Determines whether a site is the main site of the current network.
- is_user_member_of_blog()Finds out whether a user is a member of a given blog.
- is_user_option_local()Check whether a usermeta key has to do with the current blog.
- ms_upload_constants()Defines Multisite upload constants.
- refresh_blog_details()Clears the blog details cache.
- restore_current_blog()Restores the current blog, after calling switch_to_blog().
- switch_to_blog()Switches the current blog.
- update_blog_option()Updates an option for a particular blog.
- update_blog_public()Updates this blog's 'public' setting in the global blogs table.
- upgrade_280()Execute changes made in WordPress 2.8.
- wp_admin_bar_site_menu()Adds the "Site Name" menu.
Source
function get_current_blog_id() { global $blog_id; return absint( $blog_id );}History
Introduced in 3.1.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
About this page
- Parsed data
- Generated from the wordpress-develop 7.0.4 tag, from
src/wp-includes/load.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it. - Corrections
- Something wrong on this page? Report it and it gets fixed in the next regeneration.