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

You appear to be a bot. Output may be restricted

Description

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

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.

Usage

$string = site_url( $path, $scheme );

Parameters

$path
( string ) optional – Optional. Path relative to the site URL. Default empty.
$scheme
( string|null ) optional – Optional. Scheme to give the site URL context. See set_url_scheme().

Returns

string Site URL link with optional path appended.

Source

File name: wordpress/wp-includes/link-template.php
Lines:

1 to 3 of 3
function site_url( $path = '', $scheme = null ) {
  return get_site_url( null, $path, $scheme );
}
 

 View on GitHub View on Trac