返回介绍

get_network()

发布于 2017-09-10 23:35:49 字数 4162 浏览 1334 评论 0 收藏 0

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

Retrieves network data given a network ID or network object.


description

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.


参数

$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;
}

更新日志

Versiondescription
4.6.0Introduced.

相关函数

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

User Contributed Notes

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文