get_option does not respect WP_HOME, WP_SITEURL
|Reported by:||daveagp||Owned by:|
|Component:||Options, Meta APIs||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.