Summery Summery

Retrieves the URL for the current site where WordPress application files (e.g. wp-blog-header.php or the wp-admin/ folder) are accessible.

Syntax Syntax

site_url( string $path = '', string $scheme = null )

Description Description

Returns the ‘site_url’ option with the appropriate protocol, ‘https’ if is_ssl() and ‘http’ otherwise. If $scheme is ‘http’ or ‘https’, is_ssl() is overridden.

Parameters Parameters


(Optional) Path relative to the site URL.

Default value: ''


(Optional) Scheme to give the site URL context. See set_url_scheme().

Default value: null

Return Return

(string) Site URL link with optional path appended.

Source Source

File: wp-includes/link-template.php

	 * @param int|null    $blog_id     Site ID, or null for the current site.
	return apply_filters( 'home_url', $url, $path, $orig_scheme, $blog_id );


Changelog Changelog

Version Description
3.0.0 Introduced.


Leave a Reply