[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

Search

title

Body

[close]

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

These functions are needed to load Multisite.

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

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.

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.

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

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

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

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.
return: WP_Site|false Site object if successful. False when no site is found.

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.

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

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.

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.

param: WP_Network $current_site
return: WP_Network

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

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

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



Generated : Thu Nov 21 08:20:01 2024 Cross-referenced by PHPXref