mirror of
https://github.com/WordPress/WordPress.git
synced 2025-01-22 08:11:52 +01:00
Inline documentation improvements in wp-includes/ms-load.php for 3.9 functionality.
Clarifies some mixed type parameters, spacing and comment style, and language fixes. See #27700. Built from https://develop.svn.wordpress.org/trunk@28006 git-svn-id: http://core.svn.wordpress.org/trunk@27836 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
382a5aa4c2
commit
a4f4744a3b
@ -119,7 +119,7 @@ function ms_site_check() {
|
||||
*
|
||||
* @param string $domain Domain to check.
|
||||
* @param string $path Path to check.
|
||||
* @param int $segments Path segments to use. Defaults to null, or the full path.
|
||||
* @param int|null $segments Path segments to use. Defaults to null, or the full path.
|
||||
* @return object|bool Network object if successful. False when no network is found.
|
||||
*/
|
||||
function get_network_by_path( $domain, $path, $segments = null ) {
|
||||
@ -128,8 +128,10 @@ function get_network_by_path( $domain, $path, $segments = null ) {
|
||||
$domains = $exact_domains = array( $domain );
|
||||
$pieces = explode( '.', $domain );
|
||||
|
||||
// It's possible one domain to search is 'com', but it might as well
|
||||
// be 'localhost' or some other locally mapped domain.
|
||||
/*
|
||||
* It's possible one domain to search is 'com', but it might as well
|
||||
* be 'localhost' or some other locally mapped domain.
|
||||
*/
|
||||
while ( array_shift( $pieces ) ) {
|
||||
if ( $pieces ) {
|
||||
$domains[] = implode( '.', $pieces );
|
||||
@ -163,7 +165,7 @@ function get_network_by_path( $domain, $path, $segments = null ) {
|
||||
*
|
||||
* @since 3.9.0
|
||||
*
|
||||
* @param mixed $segments The number of path segments to consider. WordPress by default looks at
|
||||
* @param int|null $segments The number of path segments to consider. WordPress by default looks at
|
||||
* one path segment. The function default of null only makes sense when you
|
||||
* know the requested path should match a network.
|
||||
* @param string $domain The requested domain.
|
||||
@ -195,9 +197,10 @@ function get_network_by_path( $domain, $path, $segments = null ) {
|
||||
*
|
||||
* @since 3.9.0
|
||||
*
|
||||
* @param null|bool|object $network Network value to return by path.
|
||||
* @param string $domain The requested domain.
|
||||
* @param string $path The requested path, in full.
|
||||
* @param mixed $segments The suggested number of paths to consult.
|
||||
* @param int|null $segments The suggested number of paths to consult.
|
||||
* Default null, meaning the entire path was to be consulted.
|
||||
* @param array $paths The paths to search for, based on $path and $segments.
|
||||
*/
|
||||
@ -257,7 +260,7 @@ function get_network_by_path( $domain, $path, $segments = null ) {
|
||||
*
|
||||
* @since 3.9.0
|
||||
*
|
||||
* @param object|int $network The network's DB row or ID.
|
||||
* @param object|int $network The network's database row or ID.
|
||||
* @return object|bool Object containing network information if found, false if not.
|
||||
*/
|
||||
function wp_get_network( $network ) {
|
||||
@ -286,7 +289,7 @@ function wpmu_current_site() {
|
||||
*
|
||||
* @param string $domain Domain to check.
|
||||
* @param string $path Path to check.
|
||||
* @param int $segments Path segments to use. Defaults to null, or the full path.
|
||||
* @param int|null $segments Path segments to use. Defaults to null, or the full path.
|
||||
* @return object|bool Site object if successful. False when no site is found.
|
||||
*/
|
||||
function get_site_by_path( $domain, $path, $segments = null ) {
|
||||
@ -299,7 +302,7 @@ function get_site_by_path( $domain, $path, $segments = null ) {
|
||||
*
|
||||
* @since 3.9.0
|
||||
*
|
||||
* @param mixed $segments The number of path segments to consider. WordPress by default looks at
|
||||
* @param int|null $segments The number of path segments to consider. WordPress by default looks at
|
||||
* one path segment following the network path. The function default of
|
||||
* null only makes sense when you know the requested path should match a site.
|
||||
* @param string $domain The requested domain.
|
||||
@ -330,9 +333,10 @@ function get_site_by_path( $domain, $path, $segments = null ) {
|
||||
*
|
||||
* @since 3.9.0
|
||||
*
|
||||
* @param null|bool|object $site Site value to return by path.
|
||||
* @param string $domain The requested domain.
|
||||
* @param string $path The requested path, in full.
|
||||
* @param mixed $segments The suggested number of paths to consult.
|
||||
* @param int|null $segments The suggested number of paths to consult.
|
||||
* Default null, meaning the entire path was to be consulted.
|
||||
* @param array $paths The paths to search for, based on $path and $segments.
|
||||
*/
|
||||
@ -341,12 +345,14 @@ function get_site_by_path( $domain, $path, $segments = null ) {
|
||||
return $pre;
|
||||
}
|
||||
|
||||
// @todo
|
||||
// get_blog_details(), caching, etc. Consider alternative optimization routes,
|
||||
// perhaps as an opt-in for plugins, rather than using the pre_* filter.
|
||||
// For example: The segments filter can expand or ignore paths.
|
||||
// If persistent caching is enabled, we could query the DB for a path <> '/'
|
||||
// then cache whether we can just always ignore paths.
|
||||
/*
|
||||
* @todo
|
||||
* get_blog_details(), caching, etc. Consider alternative optimization routes,
|
||||
* perhaps as an opt-in for plugins, rather than using the pre_* filter.
|
||||
* For example: The segments filter can expand or ignore paths.
|
||||
* If persistent caching is enabled, we could query the DB for a path <> '/'
|
||||
* then cache whether we can just always ignore paths.
|
||||
*/
|
||||
|
||||
if ( count( $paths ) > 1 ) {
|
||||
$paths = "'" . implode( "', '", $wpdb->_escape( $paths ) ) . "'";
|
||||
|
Loading…
Reference in New Issue
Block a user