^ 回到顶部
  • 人生没有定律,每个人都有自己的节奏
  • 本站wordpress建站教程均通过实践后发布,希望对你有帮助
  • 希望你的坚持,都是因为热爱,而不是因为不甘心
  • 8年wordpress建站经验,5星服务品质
  • 那些不愿意让你吃亏的人,才是真正值得你深交的人,也是值得你付出时间的人
  • 阿里云2核2g仅需86元/年

wordpress函数get_current_blog_id()用法示例

get_current_blog_id()

Retrieve the current site ID.


描述


返回值

(int) Site ID.

新用户2核2g仅需86元/年    领取1153套模板    免费cdn流量包    ¥3188礼包


源代码

File: wp-includes/load.php

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

更新日志

Version 描述
3.1.0 Introduced.

相关函数

Uses

  • wp-includes/functions.php:
    absint()

Used By

  • wp-includes/ms-blogs.php:
    clean_site_details_cache()
  • wp-includes/ms-blogs.php:
    get_site()
  • wp-includes/general-template.php:
    has_custom_logo()
  • wp-includes/general-template.php:
    get_custom_logo()
  • wp-includes/functions.php:
    _wp_upload_dir()
  • wp-includes/class-wp-user-query.php:
    WP_User_Query::fill_query_vars()
  • wp-includes/customize/class-wp-customize-nav-menu-setting.php:
    WP_Customize_Nav_Menu_Setting::filter_nav_menu_options()
  • wp-includes/customize/class-wp-customize-nav-menu-setting.php:
    WP_Customize_Nav_Menu_Setting::value()
  • wp-includes/customize/class-wp-customize-nav-menu-setting.php:
    WP_Customize_Nav_Menu_Setting::preview()
  • wp-includes/customize/class-wp-customize-nav-menu-setting.php:
    WP_Customize_Nav_Menu_Setting::filter_wp_get_nav_menus()
  • wp-includes/customize/class-wp-customize-nav-menu-setting.php:
    WP_Customize_Nav_Menu_Setting::filter_wp_get_nav_menu_object()
  • wp-includes/customize/class-wp-customize-nav-menu-item-setting.php:
    WP_Customize_Nav_Menu_Item_Setting::value()
  • wp-includes/customize/class-wp-customize-nav-menu-item-setting.php:
    WP_Customize_Nav_Menu_Item_Setting::preview()
  • wp-includes/general-template.php:
    get_site_icon_url()
  • wp-includes/class-wp-customize-setting.php:
    WP_Customize_Setting::is_current_blog_previewed()
  • wp-admin/includes/ms.php:
    _access_denied_splash()
  • wp-admin/includes/ms.php:
    wpmu_delete_blog()
  • wp-admin/includes/dashboard.php:
    wp_dashboard_quick_press()
  • wp-admin/includes/user.php:
    wp_delete_user()
  • wp-admin/includes/class-wp-themes-list-table.php:
    WP_Themes_List_Table::no_items()
  • wp-admin/includes/ajax-actions.php:
    wp_ajax_autocomplete_user()
  • wp-includes/cache.php:
    WP_Object_Cache::__construct()
  • wp-includes/deprecated.php:
    get_users_of_blog()
  • wp-includes/class-wp-theme.php:
    WP_Theme::get_allowed_on_site()
  • wp-includes/load.php:
    wp_start_object_cache()
  • wp-includes/functions.php:
    is_main_site()
  • wp-includes/functions.php:
    wp_upload_dir()
  • wp-includes/link-template.php:
    get_dashboard_url()
  • wp-includes/class-wp-admin-bar.php:
    WP_Admin_Bar::initialize()
  • wp-includes/admin-bar.php:
    wp_admin_bar_site_menu()
  • wp-includes/class-wp-customize-setting.php:
    WP_Customize_Setting::preview()
  • wp-includes/user.php:
    get_blogs_of_user()
  • wp-includes/user.php:
    is_user_member_of_blog()
  • wp-includes/user.php:
    count_users()
  • wp-includes/user.php:
    wp_dropdown_users()
  • wp-includes/ms-functions.php:
    add_existing_user_to_blog()
  • wp-includes/ms-functions.php:
    update_blog_public()
  • wp-includes/ms-blogs.php:
    switch_to_blog()
  • wp-includes/ms-blogs.php:
    restore_current_blog()
  • wp-includes/ms-blogs.php:
    refresh_blog_details()
  • wp-includes/ms-blogs.php:
    get_blog_option()
  • wp-includes/ms-blogs.php:
    add_blog_option()
  • wp-includes/ms-blogs.php:
    delete_blog_option()
  • wp-includes/ms-blogs.php:
    update_blog_option()
  • wp-includes/ms-blogs.php:
    get_blog_details()
  • wp-includes/script-loader.php:
    wp_just_in_time_script_localization()
  • Show 41 more used by
    Hide more used by


  1. Skip to note content

    You must log in to vote on the helpfulness of this noteVote results for this note: 0You must log in to vote on the helpfulness of this note

    Contributed by Codex

    Example

    
    $blog_id = get_current_blog_id();
    
    

让小雨知道,这篇文章帮到了你
扫码关注微信公众号zs40086(微搜片)随时随地微信看片,抢先福利电影等你来

热门推荐

如有疑问,请前往问答中心反馈!

反馈