_config_wp_siteurl()WP 2.2.0

Retrieves the WordPress site URL.

If the constant named 'WP_SITEURL' is defined, then the value in that constant will always be returned. This can be used for debugging a site on your localhost while not having to change the database to your URL.

Internal function — this function is designed to be used by the kernel itself. It is not recommended to use this function in your code.

No Hooks.

Return

String. The WordPress site URL.

Usage

_config_wp_siteurl( $url );
$url(string)
URL to set the WordPress site location.
Default: ''

Notes

  • See: WP_SITEURL

Changelog

Since 2.2.0 Introduced.

_config_wp_siteurl() code WP 6.5.4

function _config_wp_siteurl( $url = '' ) {
	if ( defined( 'WP_SITEURL' ) ) {
		return untrailingslashit( WP_SITEURL );
	}
	return $url;
}