[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

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

Site API: WP_Site class

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

Defines 7 functions

  get_instance()
  __construct()
  to_array()
  __get()
  __isset()
  __set()
  get_details()

Functions
Functions that are not part of a class:

get_instance( $site_id )   X-Ref
Retrieves a site from the database by its ID.

since: 4.5.0
return: WP_Site|false The site's object if found. False if not.
param: int $site_id The ID of the site to retrieve.

__construct( $site )   X-Ref
Creates a new WP_Site object.

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

since: 4.5.0
param: WP_Site|object $site A site object.

to_array()   X-Ref
Converts an object to array.

since: 4.6.0
return: array Object as array.

__get( $key )   X-Ref
Getter.

Allows current multisite naming conventions when getting properties.
Allows access to extended site properties.

since: 4.6.0
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.
Checks for extended site properties.

since: 4.6.0
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.

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

get_details()   X-Ref
Retrieves the details for this site.

This method is used internally to lazy-load the extended properties of a site.

since: 4.6.0
return: stdClass A raw site object with all details included.



Generated: Fri Mar 29 01:00:02 2024 Cross-referenced by PHPXref 0.7.1