site_url WordPress Filter Hook
The site_url hook allows you to change the URL of your site. This can be useful if you want to change the domain name or the subdomain of your site. You can also use this hook to change the way your site is accessed, such as changing the www to non-www or vice versa.
apply_filters( 'site_url', string $url , string $path , string|null $scheme , int|null $blog_id ) #
Filters the site URL.
Parameters
- $url
(string)The complete site URL including scheme and path.
- $path
(string)Path relative to the site URL. Blank string if no path is specified.
- $scheme
(string|null)Scheme to give the site URL context. Accepts 'http', 'https', 'login', 'login_post', 'admin', 'relative' or null.
- $blog_id
(int|null)Site ID, or null for the current site.
Source
Changelog
Version | Description |
---|---|
2.7.0 | Introduced. |