[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

/wp-includes/ -> ms-load.php (summary)

These functions are needed to load Multisite.

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

Defines 10 functions

  is_subdomain_install()
  wp_get_active_network_plugins()
  ms_site_check()
  get_network_by_path()
  get_site_by_path()
  ms_load_current_site_and_network()
  ms_not_installed()
  get_current_site_name()
  wpmu_current_site()
  wp_get_network()

Functions
Functions that are not part of a class:

is_subdomain_install()   X-Ref
Whether a subdomain configuration is enabled.

return: bool True if subdomain configuration is enabled, false otherwise.
since: 3.0.0

wp_get_active_network_plugins()   X-Ref
Returns array of network plugin files to be included in global scope.

The default directory is wp-content/plugins. To change the default directory
manually, define `WP_PLUGIN_DIR` and `WP_PLUGIN_URL` in `wp-config.php`.

return: string[] Array of absolute paths to files to include.
since: 3.1.0

ms_site_check()   X-Ref
Checks status of current blog.

Checks if the blog is deleted, inactive, archived, or spammed.

Dies with a default message if the blog does not pass the check.

To change the default message when a blog does not pass the check,
use the wp-content/blog-deleted.php, blog-inactive.php and
blog-suspended.php drop-ins.

return: true|string Returns true on success, or drop-in file to include.
since: 3.0.0

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

return: WP_Network|false Network object if successful. False when no network is found.
since: 3.9.0
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.

get_site_by_path( $domain, $path, $segments = null )   X-Ref
Retrieves the closest matching site object by its 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 site object during bootstrap for a
requested site address

return: WP_Site|false Site object if successful. False when no site is found.
since: 3.9.0
since: 4.7.0 Updated to always return a `WP_Site` object.
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.

ms_load_current_site_and_network( $domain, $path, $subdomain = false )   X-Ref
Identifies the network and site of a requested domain and path and populates the
corresponding network and site global objects as part of the multisite bootstrap process.

Prior to 4.6.0, this was a procedural block in `ms-settings.php`. It was wrapped into
a function to facilitate unit tests. It should not be used outside of core.

Usually, it's easier to query the site first, which then declares its network.
In limited situations, we either can or must find the network first.

If a network and site are found, a `true` response will be returned so that the
request can continue.

If neither a network or site is found, `false` or a URL string will be returned
so that either an error can be shown or a redirect can occur.

return: bool|string True if bootstrap successfully populated `$current_blog` and `$current_site`.
since: 4.6.0
param: string $domain    The requested domain.
param: string $path      The requested path.
param: bool   $subdomain Optional. Whether a subdomain (true) or subdirectory (false) configuration.

ms_not_installed( $domain, $path )   X-Ref
Displays a failure message.

Used when a blog's tables do not exist. Checks for a missing $wpdb->site table as well.

since: 3.0.0
since: 4.4.0 The `$domain` and `$path` parameters were added.
param: string $domain The requested domain for the error to reference.
param: string $path   The requested path for the error to reference.

get_current_site_name( $current_site )   X-Ref
This deprecated function formerly set the site_name property of the $current_site object.

This function simply returns the object, as before.
The bootstrap takes care of setting site_name.

return: WP_Network
since: 3.0.0
param: WP_Network $current_site

wpmu_current_site()   X-Ref
This deprecated function managed much of the site and network loading in multisite.

The current bootstrap code is now responsible for parsing the site and network load as
well as setting the global $current_site object.

return: WP_Network
since: 3.0.0

wp_get_network( $network )   X-Ref
Retrieves an object containing information about the requested network.

return: WP_Network|false Object containing network information if found, false if not.
since: 3.9.0
param: object|int $network The network's database row or ID.



Generated: Tue Dec 24 01:00:02 2024 Cross-referenced by PHPXref 0.7.1