|
|
|
|
|
by deckiedan
4051 days ago
|
|
Because of this: 1) Users want to be able to update site-name (etc) from the admin interface. 2) We therefore need to store it somewhere. 3) We have a database! The alternatives are: - Storing in wp-config.php (which is also done...), but then it's not user-editable from the admin interface. - Storing in a INI or JSON or similar document, which has only marginal if any benefits over storing in the database. For deployment, since the location of the database values is fixed, you can set the variables with your deployment scripts. |
|
Storing the domain in the DB may be reasonable if it's done once, but WP does it multiple times: WP_SITEURL ("the address where your WordPress core files reside"), WP_HOME ("the address you want people to type in their browser to reach your WordPress blog") and of course GUIDs for every post have the domain hardcoded into their values (that can mess up links in a weird way, where you're on your local environment, click a link, and now you're silently on prod).
I could definitely be missing something, but I can't for the life of me figure out why this is a good idea.