[wp-trac] [WordPress Trac] #24740: get_option does not respect WP_HOME, WP_SITEURL
WordPress Trac
noreply at wordpress.org
Sat Jul 13 04:37:30 UTC 2013
#24740: get_option does not respect WP_HOME, WP_SITEURL
-------------------------+-----------------------------
Reporter: daveagp | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: General | Version: 3.5.2
Severity: normal | Keywords: has-patch
-------------------------+-----------------------------
I believe that '''get_option( $option )''' in '''option.php''' should use
WP_HOME and WP_SITEURL when they are available. This would involve adding
4 lines,
{{{
// about 10 lines into the function
if ($option == 'home' && defined('WP_HOME'))
return WP_HOME;
if ($option == 'siteurl' && defined('WP_SITEURL'))
return WP_SITEURL;
if ( defined( 'WP_SETUP_CONFIG' ) ) // old code continues here
}}}
The reason this is really important is that there is no way to run a
development site and a live site without doing hacks to core code or a
pseudo-hacky drop-in replacement for db.php. See the discussion of line
numbers in
http://codex.wordpress.org/Running_a_Development_Copy_of_WordPress
#Using_a_Drop-In for the details of why no non-hacky solution (such as
filters) can work. But if we make this enhancement, then it is a simple
matter of development sites defining these values within their '''wp-
config.php''' which to me is the most satisfying and non-hacky approach.
Feedback is welcome on the exact best location within '''get_option''' to
place this logic.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/24740>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list