[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

title

Body

[close]

/wp-includes/ -> class-wp-network.php (summary)

Network API: WP_Network class

File Size: 476 lines (12 kb)
Included or required: 1 time
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

WP_Network:: (9 methods):
  get_instance()
  __construct()
  __get()
  __isset()
  __set()
  get_main_site_id()
  _set_site_name()
  _set_cookie_domain()
  get_by_path()


Class: WP_Network  - X-Ref

Core class used for interacting with a multisite network.

This class is used during load to populate the `$current_site` global and
setup the current network.

This class is most useful in WordPress multi-network installations where the
ability to interact with any network of sites is required.

get_instance( $network_id )   X-Ref
Retrieve a network from the database by its ID.

return: WP_Network|bool The network's object if found. False if not.
param: int $network_id The ID of the network to retrieve.

__construct( $network )   X-Ref
Create a new WP_Network object.

Will populate object properties from the object provided and assign other
default properties based on that information.

param: WP_Network|object $network A network object.

__get( $key )   X-Ref
Getter.

Allows current multisite naming conventions when getting properties.

return: mixed Value of the property. Null if not available.
param: string $key Property to get.

__isset( $key )   X-Ref
Isset-er.

Allows current multisite naming conventions when checking for properties.

return: bool Whether the property is set.
param: string $key Property to check if set.

__set( $key, $value )   X-Ref
Setter.

Allows current multisite naming conventions while setting properties.

param: string $key   Property to set.
param: mixed  $value Value to assign to the property.

get_main_site_id()   X-Ref
Returns the main site ID for the network.

Internal method used by the magic getter for the 'blog_id' and 'site_id'
properties.

return: int The ID of the main site.

_set_site_name()   X-Ref
Set the site name assigned to the network if one has not been populated.


_set_cookie_domain()   X-Ref
Set the cookie domain based on the network domain if one has
not been populated.


get_by_path( $domain = '', $path = '', $segments = null )   X-Ref
Retrieve the closest matching network for a domain and path.

This will not necessarily return an exact match for a domain and path. Instead, it
breaks the domain and path into pieces that are then used to match the closest
possibility from a query.

The intent of this method is to match a network during bootstrap for a
requested site address.

return: WP_Network|bool Network object if successful. False when no network is found.
param: string   $domain   Domain to check.
param: string   $path     Path to check.
param: int|null $segments Path segments to use. Defaults to null, or the full path.



Generated: Fri Oct 25 08:20:01 2019 Cross-referenced by PHPXref 0.7