[wp-trac] [WordPress Trac] #19799: define('RELOCATE', true) update the "siteurl" option, but not the "home" option

WordPress Trac wp-trac at lists.automattic.com
Tue Jan 10 23:40:43 UTC 2012


#19799: define('RELOCATE', true) update the "siteurl" option, but not the "home"
option
-----------------------------+-----------------------------
 Reporter:  mintindeed       |      Owner:
     Type:  defect (bug)     |     Status:  new
 Priority:  normal           |  Milestone:  Awaiting Review
Component:  Upgrade/Install  |    Version:  3.3
 Severity:  normal           |   Keywords:  has-patch
-----------------------------+-----------------------------
 define('RELOCATE', true) will update the "siteurl" option, but not the
 "home" option.

 Things like the_permalink() use home_url(), which uses the "home" option,
 so URLs break after using RELOCATE.  Post permalinks, "Visit Site" in the
 admin, etc, all point to the old domain.

 Steps to reproduce: set up a blog at one domain, say "http://example.com"
 and then use RELOCATE to relocate the blog to "http://example.local".
 Links in the admin will work, but "Visit Site" in the admin bar will point
 to the old domain.  Likewise, permalinks and other links on the frontend
 of the site will also still point to the old domain.

 Is this by design?

 I'm attaching a patch that also updates the "home" option when using
 RELOCATE.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/19799>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list