[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)





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

Network API: WP_Network class

File Size: 473 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
Retrieves 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.

__construct( $network )   X-Ref
Creates 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

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

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

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'

return: int The ID of the main site.

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

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

get_by_path( $domain = '', $path = '', $segments = null )   X-Ref
Retrieves 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.

Generated : Fri Aug 19 08:20:02 2022 Cross-referenced by PHPXref