diff --git src/wp-includes/ms-load.php src/wp-includes/ms-load.php
index efe5376..865e39f 100644
|
|
|
function get_network_by_path( $domain, $path, $segments = null ) { |
| 280 | 280 | * |
| 281 | 281 | * @since 3.9.0 |
| 282 | 282 | * |
| 283 | | * @param int $network_id The network's DB row or ID. |
| 284 | | * @return mixed Object containing network information if found, false if not. |
| | 283 | * @param object|int $network The network's DB row or ID. |
| | 284 | * @return object|bool Object containing network information if found, false if not. |
| 285 | 285 | */ |
| 286 | 286 | function wp_get_network( $network ) { |
| 287 | 287 | global $wpdb; |
| … |
… |
function wpmu_current_site() { |
| 315 | 315 | function get_site_by_path( $domain, $path, $segments = null ) { |
| 316 | 316 | global $wpdb; |
| 317 | 317 | |
| 318 | | $path_segments = array_filter( explode( '/', trim( $path, "/" ) ) ); |
| | 318 | $path_segments = array_filter( explode( '/', trim( $path, '/' ) ) ); |
| 319 | 319 | |
| 320 | 320 | /** |
| 321 | 321 | * Filter the number of path segments to consider when searching for a site. |
| 322 | 322 | * |
| 323 | 323 | * @since 3.9.0 |
| 324 | 324 | * |
| 325 | | |
| 326 | 325 | * @param mixed $segments The number of path segments to consider. WordPress by default looks at |
| 327 | 326 | * one path segment following the network path. The function default of |
| 328 | 327 | * null only makes sense when you know the requested path should match a site. |
| … |
… |
function get_site_by_path( $domain, $path, $segments = null ) { |
| 331 | 330 | */ |
| 332 | 331 | $segments = apply_filters( 'site_by_path_segments_count', $segments, $domain, $path ); |
| 333 | 332 | |
| 334 | | if ( null !== $segments && count($path_segments ) > $segments ) { |
| | 333 | if ( null !== $segments && count( $path_segments ) > $segments ) { |
| 335 | 334 | $path_segments = array_slice( $path_segments, 0, $segments ); |
| 336 | 335 | } |
| 337 | 336 | |