[wp-trac] [WordPress Trac] #11159: WP_SITEURL and bloginfo('siteurl') inconsistent, or WP_SITEURL should be defined
WordPress Trac
wp-trac at lists.automattic.com
Tue Nov 17 06:48:40 UTC 2009
#11159: WP_SITEURL and bloginfo('siteurl') inconsistent, or WP_SITEURL should be
defined
--------------------------+-------------------------------------------------
Reporter: anmari | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Unassigned
Component: General | Version:
Severity: minor | Keywords: WP_SITEURL, constants
--------------------------+-------------------------------------------------
The wordpress directory constant WP_SITEURL remains undefined if not
defined in wp-config.php , although other constants referred to in
http://codex.wordpress.org/Editing_wp-config.php '''do get defined''' in
wp-settings.php. See from around line 109 and lines 228, 362, 370 etc
onwards.
get_bloginfo('siteurl') defaults to get_bloginfo('home'). If a developer
uses get_bloginfo('siteurl') and the wp install has wp_siteurl defined in
the config file - the "wrong" url is returned from what the developer
expects.
So while a developer can use other constants, they cannot reliably use
WP_SITEURL. They must check for definition of WP_SITEURL and define
WP_SITEURL themselves using 'wp_url', not 'siteurl', as that gives same as
'home', or always use bloginfo('wp-url') - slower.
See: general-template.php (in 2.9) lines 303 on has:
case 'url' :
case 'home' : // DEPRECATED
case 'siteurl' : // DEPRECATED
$output = get_option('home');
break;
case 'wpurl' :
$output = get_option('siteurl');
break;
Surely
1) bloginfo('siteurl') even if deprecated, should call option('siteurl'),
as per bloginfo('wp_url'), not 'home'
OR
2) WP_SITEURL (or WP_WPURL!!) should be defined in wp-settings if not
defined in config
--
Ticket URL: <http://core.trac.wordpress.org/ticket/11159>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list