home_url
Filters the home URL.
Использование
add_filter( 'home_url', 'wp_kama_home_url_filter', 10, 4 );
/**
* Function for `home_url` filter-hook.
*
* @param string $url The complete home URL including scheme and path.
* @param string $path Path relative to the home URL. Blank string if no path is specified.
* @param string|null $orig_scheme Scheme to give the home URL context. Accepts 'http', 'https', 'relative', 'rest', or null.
* @param int|null $blog_id Site ID, or null for the current site.
*
* @return string
*/
function wp_kama_home_url_filter( $url, $path, $orig_scheme, $blog_id ){
// filter...
return $url;
}
- $url(строка)
- The complete home URL including scheme and path.
- $path(строка)
- Path relative to the home URL. Blank string if no path is specified.
- $orig_scheme(строка|null)
- Scheme to give the home URL context. Accepts 'http', 'https', 'relative', 'rest', or null.
- $blog_id(int|null)
- Site ID, or null for the current site.
Список изменений
| С версии 3.0.0 | Введена. |
Где вызывается хук
home_url
wp-includes/link-template.php 3496
return apply_filters( 'home_url', $url, $path, $orig_scheme, $blog_id );