• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
WordPress core a2z

WordPress core a2z

WordPress core only

  • Home
  • Plugins
  • Blocks
  • Shortcodes
  • APIs
  • Classes
  • Files
  • Hooks
  • Sitemap
  • Blog
Home / APIs / 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

Published: 25th November 2019 | Last updated: 25th November 2019

Primary Sidebar

Information

Function name: site_url
Plugin ref: WordPress
Version: 5.7.1
Sourcefile: wp-includes/link-template.php
File ref: wp-includes/link-template.php
Deprecated?: No
API Letters: S,U

Footer

WP-a2z
WordPress core a2z
WordPress core only
WordPress 5.7.1
WordPress a2z
WordPress core a2z
Genesis Theme Framework a2z
Jetpack a2z
WordPress develop tests
Easy Digital Downloads a2z
WooCommerce a2z
Yoast SEO a2z
WordPress Blocks

Site:  core.wp-a2z.org
© Copyright WP-a2z 2014-2021. All rights reserved.


Website designed and developed by Herb Miller
Proudly powered by WordPress and oik plugins

  • Home
  • Blog
  • Sitemap
  • Sites