WP_CONTENT_URL Defined before wp-config.php causes incorrect links when defining WP_SITEURL
|Reported by:||sethmatics||Owned by:|
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?
- Define the above in wp-config.php
- echo out get_stylesheet_directory() and note that it follows the database content instead of the content you intended to define.