_config_wp_home

Retrieve the WordPress home page URL.

Description

(string) _config_wp_home( (string) $url = '' ); 

If the constant named WP_HOME exists, then it will be used and returned by the function. This can be used to counter the redirection on your local development environment.

Returns (string)

Homepage location.

Parameters (1)

0. $url — Optional. (string) => ''
URL for the home location.

Usage

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

Defined (1)

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

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