[wp-trac] [WordPress Trac] #26890: Add a switch themes link to the Theme Customizer
WordPress Trac
noreply at wordpress.org
Thu Jan 15 01:01:41 UTC 2015
#26890: Add a switch themes link to the Theme Customizer
------------------------------+-----------------------
Reporter: celloexpressions | Owner:
Type: enhancement | Status: reopened
Priority: normal | Milestone: 4.2
Component: Customize | Version: 3.4
Severity: normal | Resolution:
Keywords: has-patch | Focuses: ui
------------------------------+-----------------------
Comment (by westonruter):
Customize Transactions (#30937) would provide an easy way to implement
theme switching from within the Customizer.
With transactions, any setting change gets stored in a persistent
`wp_transaction` post. It allows you to load the Customizer with the
transaction specified in the URL, allowing the full state of the settings
in the Customizer to be restored. In the context of a theme-switch link,
the way it would work given the current state of transactions:
1. Load the customizer `/wp-admin/customize.php`. Since no transaction is
specified, a transaction UUID is generated and made available in a JS
setting.
2. Make some changes to controls if desired. Any changes to settings here
get synced to WP and persisted in `wp_transaction` post.
3. Open the Themes panel and select a different theme, e.g.
`twentyfifteen`
4. The browser would then navigate to `/wp-
admin/customize.php?theme=twentyfifteen&customize_transaction_uuid=$uuid&url=$url`,
where `$url` is the current page being previewed in the Customizer
Preview, and `$uuid` is the UUID that was generated when the page loads.
5. The Customizer loads and any settings in the transaction are restored
to the controls, and the new theme is now appearing in the preview.
While reloading the Customizer in the context of the switched-to theme is
the easiest way to refresh the UI, a better user experience would be to
dynamically populate the Customizer pane with any new
panels/sections/controls that the new theme defines. This ability would be
dependent on #28580, the Customizer Preview would need to be able to
`postMessage` the panels, sections, and controls that are registered.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/26890#comment:11>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list