apply_filters( 'site_url', string $url, string $path, string|null $scheme, int|null $blog_id )
- Since
- 2.7.0
Filters the site URL.
Compatibility
- WordPress
- since 2.7.0
- 6.7.7
- 6.8.8
- 6.9.7
- 7.0.4
- 7.1.0
Present in every tracked release (6.7.7 to 7.1.0).
Parameters
$urlstring- The complete site URL including scheme and path.
$pathstring- Path relative to the site URL. Blank string if no path is specified.
$schemestring|null- Scheme to give the site URL context. Accepts 'http', 'https', 'login', 'login_post', 'admin', 'relative' or null.
$blog_idint|null- Site ID, or null for the current site.
Where this hook fires · 2
wp-includes/https-detection.php:58wp_is_site_url_using_https()wp-includes/link-template.php:3560get_site_url()
Source code
* @param string $url The complete site URL including scheme and path. * @param string $path Path relative to the site URL. Blank string if no path is specified. * @param string|null $scheme Scheme to give the site URL context. Accepts 'http', 'https', 'login', * 'login_post', 'admin', 'relative' or null. * @param int|null $blog_id Site ID, or null for the current site. */ return apply_filters( 'site_url', $url, $path, $scheme, $blog_id );} /** * Retrieves the URL to the admin area for the current site. * * @since 2.6.0Changelog
Introduced in 2.7.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
About this page
- Parsed data
- Generated from the wordpress-develop 7.0.4 tag, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
- Corrections
- Something wrong on this page? Report it and it gets fixed in the next regeneration.