_config_wp_siteurl

Retrieve the WordPress site URL.

Description

(string) _config_wp_siteurl( (string) $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.

Returns (string)

The WordPress Site URL.

Parameters (1)

0. $url — Optional. (string) => ''
URL to set the WordPress site location.

Usage

  1. if ( !function_exists( '_config_wp_siteurl' ) ) { 
  2. require_once ABSPATH . WPINC . '/functions.php'; 
  3.  
  4. // URL to set the WordPress site location. 
  5. $url = ''; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = _config_wp_siteurl($url); 
  9.  

Defined (1)

The function is defined in the following location(s).

/wp-includes/functions.php  
  1. function _config_wp_siteurl( $url = '' ) { 
  2. if ( defined( 'WP_SITEURL' ) ) 
  3. return untrailingslashit( WP_SITEURL ); 
  4. return $url;