[wp-trac] [WordPress Trac] #17789: WP_CONTENT_URL Defined before wp-config.php causes incorrect links when defining WP_SITEURL

WordPress Trac wp-trac at lists.automattic.com
Tue Jun 14 02:42:27 UTC 2011


#17789: WP_CONTENT_URL Defined before wp-config.php causes incorrect links when
defining WP_SITEURL
--------------------------+-----------------------------
 Reporter:  sethmatics    |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:  3.2
 Severity:  normal        |   Keywords:
--------------------------+-----------------------------
 When attempting to use to defined constants to make wordpress more "cross
 domain friendly" for my development subdomains we found an issue.
 {{{
 define('WP_SITEURL', 'http://' . $_SERVER['SERVER_NAME']);
 define('WP_HOME', 'http://' . $_SERVER['SERVER_NAME']);
 define('WP_CONTENT_URL', 'http://' . $_SERVER['SERVER_NAME'] . '/wp-
 content');
 }}}
 However, the constant WP_CONTENT_URL is defined before loading the wp-
 config file so the last define fails. Similar to ticket #13941, I'm having
 an issue with how content_url() function is returning the WP_CONTENT_URL
 which I can't modify to match the rest of my constants.

 *when testing, make sure that your WP_SITEURL is different then the one
 defined in the database, maybe by using a "www." prefix for example.

 How do you get the "bug" to occur?
 1. Define the above in wp-config.php
 2. echo out get_stylesheet_directory() and note that it follows the
 database content instead of the content you intended to define.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/17789>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list