#4003 closed enhancement (fixed)
Set 'home' and 'siteurl' options in wp-config.php
Reported by: | filosofo | Owned by: | charleshooper |
---|---|---|---|
Milestone: | 2.2 | Priority: | low |
Severity: | normal | Version: | |
Component: | Administration | Keywords: | home siteurl wp-config has-patch |
Focuses: | Cc: |
Description
I can't tell you how often I end up editing the database just to change the 'siteurl' and 'home' options.
Recently on the hackers list Matt suggested that it might have been a good thing to have put the those options in wp-config.php, and I agree.
My patch allows you to set the constants "WP_HOME" and "WP_SITEURL" in wp-config.php, in which case they will override the db settings (and gray out those fields in the admin options page).
As far as I can tell, this is something that would have to be done with a core change like this, because plugins are read too late after 'home' and 'siteurl' have already been used in wp-settings.php.
Attachments (2)
Change History (14)
#2
@
17 years ago
+100
This is the most requested feature I have seen when considering using WordPress in a staged environment.
Now we just need the facility (plugin) to fix all the absolute urls in page content that are broken when this is changed ;-)
#3
@
17 years ago
Agreed, this would be MORE than useful, and is also the subject of at least 2 ideas in the ideas section.
http://wordpress.org/extend/ideas/topic.php?id=70&page&replies=9
http://wordpress.org/extend/ideas/topic.php?id=142&page&replies=4
#7
@
17 years ago
is_blog_installed is more of a DB check. Since we always create a siteurl option during install, I think we can leave it as is. We might want to change it to return true/false so that no one is tempted to use the return value as anything other than a bool.
#8
@
17 years ago
+1 for the boolean return, I'll submit the patch here in a few. I did notice that in wp_install() we do a update_option('siteurl', $guessurl), I think it's a good idea to override $guessurl if WP_SITEURL is already definied
@
17 years ago
Updated version of patch.diff to check WP_SITEURL value during install and also change is_blog_installed to return boolean value
#10
@
17 years ago
- Owner changed from anonymous to charleshooper
- Status changed from new to assigned
I've added a new patch, although I'm not sure why I can't preview it :-/
1