Changeset 28006
- Timestamp:
- 04/07/2014 08:58:11 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/ms-load.php
r27439 r28006 118 118 * @since 3.9.0 119 119 * 120 * @param string $domain Domain to check.121 * @param string $path Path to check.122 * @param int 120 * @param string $domain Domain to check. 121 * @param string $path Path to check. 122 * @param int|null $segments Path segments to use. Defaults to null, or the full path. 123 123 * @return object|bool Network object if successful. False when no network is found. 124 124 */ … … 129 129 $pieces = explode( '.', $domain ); 130 130 131 // It's possible one domain to search is 'com', but it might as well 132 // be 'localhost' or some other locally mapped domain. 131 /* 132 * It's possible one domain to search is 'com', but it might as well 133 * be 'localhost' or some other locally mapped domain. 134 */ 133 135 while ( array_shift( $pieces ) ) { 134 136 if ( $pieces ) { … … 164 166 * @since 3.9.0 165 167 * 166 * @param mixed$segments The number of path segments to consider. WordPress by default looks at167 * one path segment. The function default of null only makes sense when you168 * know the requested path should match a network.169 * @param string $domain The requested domain.170 * @param string $path The requested path, in full.168 * @param int|null $segments The number of path segments to consider. WordPress by default looks at 169 * one path segment. The function default of null only makes sense when you 170 * know the requested path should match a network. 171 * @param string $domain The requested domain. 172 * @param string $path The requested path, in full. 171 173 */ 172 174 $segments = apply_filters( 'network_by_path_segments_count', $segments, $domain, $path ); … … 196 198 * @since 3.9.0 197 199 * 198 * @param string $domain The requested domain. 199 * @param string $path The requested path, in full. 200 * @param mixed $segments The suggested number of paths to consult. 201 * Default null, meaning the entire path was to be consulted. 202 * @param array $paths The paths to search for, based on $path and $segments. 200 * @param null|bool|object $network Network value to return by path. 201 * @param string $domain The requested domain. 202 * @param string $path The requested path, in full. 203 * @param int|null $segments The suggested number of paths to consult. 204 * Default null, meaning the entire path was to be consulted. 205 * @param array $paths The paths to search for, based on $path and $segments. 203 206 */ 204 207 $pre = apply_filters( 'pre_get_network_by_path', null, $domain, $path, $segments, $paths ); … … 258 261 * @since 3.9.0 259 262 * 260 * @param object|int $network The network's DBrow or ID.263 * @param object|int $network The network's database row or ID. 261 264 * @return object|bool Object containing network information if found, false if not. 262 265 */ … … 285 288 * @since 3.9.0 286 289 * 287 * @param string $domain Domain to check.288 * @param string $path Path to check.289 * @param int 290 * @param string $domain Domain to check. 291 * @param string $path Path to check. 292 * @param int|null $segments Path segments to use. Defaults to null, or the full path. 290 293 * @return object|bool Site object if successful. False when no site is found. 291 294 */ … … 300 303 * @since 3.9.0 301 304 * 302 * @param mixed$segments The number of path segments to consider. WordPress by default looks at303 * one path segment following the network path. The function default of304 * null only makes sense when you know the requested path should match a site.305 * @param string $domain The requested domain.306 * @param string $path The requested path, in full.305 * @param int|null $segments The number of path segments to consider. WordPress by default looks at 306 * one path segment following the network path. The function default of 307 * null only makes sense when you know the requested path should match a site. 308 * @param string $domain The requested domain. 309 * @param string $path The requested path, in full. 307 310 */ 308 311 $segments = apply_filters( 'site_by_path_segments_count', $segments, $domain, $path ); … … 331 334 * @since 3.9.0 332 335 * 333 * @param string $domain The requested domain. 334 * @param string $path The requested path, in full. 335 * @param mixed $segments The suggested number of paths to consult. 336 * Default null, meaning the entire path was to be consulted. 337 * @param array $paths The paths to search for, based on $path and $segments. 336 * @param null|bool|object $site Site value to return by path. 337 * @param string $domain The requested domain. 338 * @param string $path The requested path, in full. 339 * @param int|null $segments The suggested number of paths to consult. 340 * Default null, meaning the entire path was to be consulted. 341 * @param array $paths The paths to search for, based on $path and $segments. 338 342 */ 339 343 $pre = apply_filters( 'pre_get_site_by_path', null, $domain, $path, $segments, $paths ); … … 342 346 } 343 347 344 // @todo 345 // get_blog_details(), caching, etc. Consider alternative optimization routes, 346 // perhaps as an opt-in for plugins, rather than using the pre_* filter. 347 // For example: The segments filter can expand or ignore paths. 348 // If persistent caching is enabled, we could query the DB for a path <> '/' 349 // then cache whether we can just always ignore paths. 348 /* 349 * @todo 350 * get_blog_details(), caching, etc. Consider alternative optimization routes, 351 * perhaps as an opt-in for plugins, rather than using the pre_* filter. 352 * For example: The segments filter can expand or ignore paths. 353 * If persistent caching is enabled, we could query the DB for a path <> '/' 354 * then cache whether we can just always ignore paths. 355 */ 350 356 351 357 if ( count( $paths ) > 1 ) {
Note: See TracChangeset
for help on using the changeset viewer.