WP hooks navigation: Home/browse • Actions index • Filters index
To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).
The best way to understand what a hook does is to look at where it occurs in the source code.
do_action( "hook_name" )apply_filters( "hook_name", "what_to_filter" ).Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.
| Line | Code |
|---|---|
| 161 | * |
| 162 | * @since 3.9.0 |
| 163 | * |
| 164 | * @param int|null $segments The number of path segments to consider. WordPress by default looks at |
| 165 | * one path segment following the network path. The function default of |
| 166 | * null only makes sense when you know the requested path should match a site. |
| 167 | * @param string $domain The requested domain. |
| 168 | * @param string $path The requested path, in full. |
| 169 | */ |
| 170 | $segments = apply_filters( 'site_by_path_segments_count', $segments, $domain, $path ); |
| 171 | |
| 172 | if ( null !== $segments && count( $path_segments ) > $segments ) { |
| 173 | $path_segments = array_slice( $path_segments, 0, $segments ); |
| 174 | } |
| 175 | |
| 176 | $paths = array(); |
| 177 | |
| 178 | while ( count( $path_segments ) ) { |
| 179 | $paths[] = '/' . implode( '/', $path_segments ) . '/'; |