network_by_path_segments_count хук-фильтрWP 3.9.0

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

Использование

add_filter( 'network_by_path_segments_count', 'wp_kama_network_by_path_segments_count_filter', 10, 3 );

/**
 * Function for `network_by_path_segments_count` filter-hook.
 * 
 * @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.
 *
 * @return int|null
 */
function wp_kama_network_by_path_segments_count_filter( $segments, $domain, $path ){

	// filter...
	return $segments;
}
$segments(int|null)
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.
$domain(строка)
The requested domain.
$path(строка)
The requested path, in full.

Список изменений

С версии 3.9.0 Введена.

Где вызывается хук

WP_Network::get_by_path()
network_by_path_segments_count
wp-includes/class-wp-network.php 380
$segments = apply_filters( 'network_by_path_segments_count', $segments, $domain, $path );

Где используется хук в WordPress

Использование не найдено.