wppaste
WordPress

apply_filters( 'site_by_path_segments_count', int|null $segments, string $domain, string $path )

Since
3.9.0
Filters the number of path segments to consider when searching for a site.

Compatibility

WordPress
since 3.9.0
  • 6.7.7
  • 6.8.8
  • 6.9.7
  • 7.0.4
  • 7.1.0

Present in every tracked release (6.7.7 to 7.1.0).

Parameters

$segmentsint|null
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.
$domainstring
The requested domain.
$pathstring
The requested path, in full.

Where this hook fires · 1

  • wp-includes/ms-load.php:177get_site_by_path()

Source code

	 * @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 ); 	if ( null !== $segments && count( $path_segments ) > $segments ) {		$path_segments = array_slice( $path_segments, 0, $segments );	} 	$paths = array();

Changelog

Introduced in 3.9.0. Unchanged from 6.7.7 through 7.1.0.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 7.1.0

Signature, return type and hooks compared across 5 parsed releases.

About this page

Parsed data
Generated from the wordpress-develop 6.9.7 tag, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.