[ Index ]

PHP Cross Reference of WordPress




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

Network API: WP_Network class

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

Defines 1 class

WP_Network:: (9 methods):

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|false The network's object if found. False if not.
param: int $network_id The ID of the network to retrieve.
since: 4.4.0

__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.
since: 4.4.0

__get( $key )   X-Ref

Allows current multisite naming conventions when getting properties.

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

__isset( $key )   X-Ref

Allows current multisite naming conventions when checking for properties.

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

__set( $key, $value )   X-Ref

Allows current multisite naming conventions while setting properties.

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

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'

return: int The ID of the main site.
since: 4.9.0

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

since: 4.4.0

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

since: 4.4.0

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|false 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.
since: 4.4.0

Generated: Mon Jun 21 01:00:04 2021 Cross-referenced by PHPXref 0.7.1