[wp-trac] [WordPress Trac] #20507: 3.4 Preview/Customize page "Return to Manage Themes" link doesn't work as expected

WordPress Trac wp-trac at lists.automattic.com
Wed Jun 20 18:44:17 UTC 2012


#20507: 3.4 Preview/Customize page "Return to Manage Themes" link doesn't work as
expected
--------------------------+--------------------------
 Reporter:  TomAuger      |       Owner:  koopersmith
     Type:  defect (bug)  |      Status:  closed
 Priority:  normal        |   Milestone:  3.4
Component:  Appearance    |     Version:  3.4
 Severity:  normal        |  Resolution:  fixed
 Keywords:                |
--------------------------+--------------------------

Comment (by nacin):

 There have been some inquiries into why we ended up handling cross-domain
 issues instead of serving the preview via the admin instead of the
 frontend, or serving the controls via the frontend instead of the admin.
 Indeed, one strategy was [comment:4 initially decided upon above] —
 serving the controls through the frontend. That wouldn't have worked since
 we needed not only the admin styles, but also register_setting(), wp-admin
 auth cookies, and more. But the reverse — serving the preview through the
 admin — was a very interesting thought.

 This wp-admin endpoint to serve the preview would have needed to act like
 it wasn't a part of the admin for everything but the URL. In theory, it
 sounded pretty cool, but in practice, it would have had major side effects
 and would have led us down a rabbit hole of constant compatibility
 problems. It would have needed to use WP::main() in unusual ways and
 leveraged the front-end template-loader as well. We would have had to
 trick WP_Query into thinking it was not querying in the admin. Any theme
 doing is_admin() {} else {}, or using admin_init, or anything else, could
 have potentially broke. Any plugins hooking into WP, WP_Query, the
 template loader, or the template could have potentially been confused.

 Mind you, all of this was to avoid something so simple as this: If you are
 using a mapped domain, un-map it for the customizer.

 And so, we agreed to handle cross-domain origin issues the best we could
 (and given that it works on WP.com, we did exactly that), in order to be
 as compatible and as flexible as possible. But emphasis would then be
 placed on the simple solution of simply unmapping the front-end domain
 when using the customizer.

 Solving our cross-domain origin issues allowed us to understand these
 problems and open up new doors (for example, #21024), and that (plus
 recommending the unmapping of the domain — hey look, problem solved!) was
 ultimately way less of a headache than trying to wedge the preview into
 the admin or vice versa.

 (References: An IRC conversation from
 [https://irclogs.wordpress.org/chanlog.php?channel=wordpress-
 dev&day=2012-05-07&sort=asc#m393167 May 7].)

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/20507#comment:5>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list