W3cubDocs

/WordPress

_config_wp_siteurl( string $url = ): string

Retrieves the WordPress site URL.

Description

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.

See also

Parameters

$urlstringoptional
URL to set the WordPress site location.

Default:''

Return

string The WordPress site URL.

Source

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

Changelog

Version Description
2.2.0 Introduced.

© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/_config_wp_siteurl