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

wordpress函数get_network()用法示例

get_network( WP_Network|int|null $network = null )

Retrieves network data given a network ID or network object.


描述

Network data will be cached and returned after being passed through a filter. If the provided network is empty, the current network global will be used.

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


参数

$network

(WP_Network|int|null)
(Optional)
Network to retrieve. Default is the current network.

Default value: null


返回值

(WP_Network|null) The network object or null if not found.


源代码

File: wp-includes/ms-blogs.php

function get_network( $network = null ) {
	global $current_site;
	if ( empty( $network ) && isset( $current_site ) ) {
		$network = $current_site;
	}

	if ( $network instanceof WP_Network ) {
		$_network = $network;
	} elseif ( is_object( $network ) ) {
		$_network = new WP_Network( $network );
	} else {
		$_network = WP_Network::get_instance( $network );
	}

	if ( ! $_network ) {
		return null;
	}

	/**
	 * Fires after a network is retrieved.
	 *
	 * @since 4.6.0
	 *
	 * @param WP_Network $_network Network data.
	 */
	$_network = apply_filters( 'get_network', $_network );

	return $_network;
}

更新日志

Version 描述
4.6.0 Introduced.

相关函数

Uses

  • wp-includes/ms-blogs.php:
    get_network
  • wp-includes/class-wp-network.php:
    WP_Network::__construct()
  • wp-includes/class-wp-network.php:
    WP_Network::get_instance()
  • wp-includes/plugin.php:
    apply_filters()

Used By

  • wp-includes/load.php:
    get_current_network_id()
  • wp-includes/class-wp-network-query.php:
    WP_Network_Query::get_networks()
  • wp-includes/functions.php:
    get_main_network_id()
  • wp-admin/includes/class-wp-ms-sites-list-table.php:
    WP_MS_Sites_List_Table::handle_row_actions()
  • wp-admin/includes/class-wp-ms-users-list-table.php:
    WP_MS_Users_List_Table::column_blogs()
  • wp-login.php:
    retrieve_password()
  • wp-login.php:
    login_header()
  • wp-signup.php:
    signup_another_blog()
  • wp-signup.php:
    signup_user()
  • wp-signup.php:
    show_blog_form()
  • wp-admin/includes/ms.php:
    wpmu_delete_blog()
  • wp-admin/includes/schema.php:
    populate_options()
  • wp-admin/includes/upgrade.php:
    wp_install_defaults()
  • wp-includes/functions.php:
    is_main_site()
  • wp-includes/link-template.php:
    network_site_url()
  • wp-includes/link-template.php:
    network_home_url()
  • wp-includes/http.php:
    ms_allowed_http_request_hosts()
  • wp-includes/admin-bar.php:
    wp_admin_bar_site_menu()
  • wp-includes/ms-functions.php:
    add_new_user_to_blog()
  • wp-includes/ms-functions.php:
    fix_phpmailer_messageid()
  • wp-includes/ms-functions.php:
    wpmu_welcome_user_notification()
  • wp-includes/ms-functions.php:
    redirect_this_site()
  • wp-includes/ms-functions.php:
    install_blog()
  • wp-includes/ms-functions.php:
    wpmu_welcome_notification()
  • wp-includes/ms-functions.php:
    wpmu_validate_blog_signup()
  • wp-includes/ms-load.php:
    wp_get_network()
  • wp-includes/ms-load.php:
    ms_site_check()
  • wp-includes/ms-deprecated.php:
    get_dashboard_blog()
  • wp-includes/ms-blogs.php:
    get_id_from_blogname()
  • wp-includes/ms-default-constants.php:
    ms_cookie_constants()
  • Show 25 more used by
    Hide more used by


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

热门推荐

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

反馈