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:
Drew Jaynes 2014-04-07 20:59:15 +00:00
parent 382a5aa4c2
commit a4f4744a3b

View File

@ -117,9 +117,9 @@ function ms_site_check() {
*
* @since 3.9.0
*
* @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 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 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,11 +165,11 @@ 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
* 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.
* @param string $path The requested path, in full.
* @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.
* @param string $path The requested path, in full.
*/
$segments = apply_filters( 'network_by_path_segments_count', $segments, $domain, $path );
@ -195,11 +197,12 @@ function get_network_by_path( $domain, $path, $segments = null ) {
*
* @since 3.9.0
*
* @param string $domain The requested domain.
* @param string $path The requested path, in full.
* @param mixed $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.
* @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 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.
*/
$pre = apply_filters( 'pre_get_network_by_path', null, $domain, $path, $segments, $paths );
if ( null !== $pre ) {
@ -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 ) {
@ -284,9 +287,9 @@ function wpmu_current_site() {
*
* @since 3.9.0
*
* @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 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 object|bool Site object if successful. False when no site is found.
*/
function get_site_by_path( $domain, $path, $segments = null ) {
@ -299,11 +302,11 @@ 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
* 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.
* @param string $path The requested path, in full.
* @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.
* @param string $path The requested path, in full.
*/
$segments = apply_filters( 'site_by_path_segments_count', $segments, $domain, $path );
@ -330,23 +333,26 @@ function get_site_by_path( $domain, $path, $segments = null ) {
*
* @since 3.9.0
*
* @param string $domain The requested domain.
* @param string $path The requested path, in full.
* @param mixed $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.
* @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 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.
*/
$pre = apply_filters( 'pre_get_site_by_path', null, $domain, $path, $segments, $paths );
if ( null !== $pre ) {
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 ) ) . "'";