home_url
Filters the home URL.
Usage
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(string)
- The complete home URL including scheme and path.
- $path(string)
- Path relative to the home URL. Blank string if no path is specified.
- $orig_scheme(string|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.
Changelog
Since 3.0.0 | Introduced. |
Where the hook is called
home_url
wp-includes/link-template.php 3464
return apply_filters( 'home_url', $url, $path, $orig_scheme, $blog_id );