Skip to content
This repository has been archived by the owner on Dec 27, 2022. It is now read-only.

Add support for persisting the Customizer state through form submissions #72

Conversation

westonruter
Copy link
Contributor

In the Customizer preview, the changes here allow for forms with a GET request method to be submitted and for the resultant URL to be loaded in the preview. This fixes a Core enhancement #20714: Theme customizer: Impossible to preview a search results page. The reason for disallowing POST requests is that they normally should entail mutating the server state which should be forbidden when using the Customizer, as all changes should flow through Customizer settings and only affected once hitting “Save & Publish”. If a form has a POST request method then any submit buttons will have a not-allowed cursor.

Likewise, when previewing the Customizer state on the frontend (when the customize_snapshot_uuid query param is present), all forms that have action URLs pointing to the WP instance in the current document will be amended to have a customize_snapshot_uuid named input element. In this way, any form submissions done on the frontend will also result in the previewed Customizer state being persisted in the response.

@westonruter westonruter merged commit 9d1ad7a into feature/previewing-improvements Aug 10, 2016
@westonruter westonruter deleted the feature/previewing-form-submissions branch August 10, 2016 05:09
@westonruter westonruter modified the milestone: 0.5.0 Aug 12, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant