This repository was archived by the owner on Dec 27, 2022. It is now read-only.
Add support for persisting the Customizer state through form submissions#72
Merged
westonruter merged 6 commits intoAug 10, 2016
Conversation
This fixes #20714: Theme customizer: Impossible to preview a search results page <https://core.trac.wordpress.org/ticket/20714>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In the Customizer preview, the changes here allow for forms with a
GETrequest 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 disallowingPOSTrequests 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 aPOSTrequest method then any submit buttons will have anot-allowedcursor.Likewise, when previewing the Customizer state on the frontend (when the
customize_snapshot_uuidquery param is present), all forms that haveactionURLs pointing to the WP instance in the current document will be amended to have acustomize_snapshot_uuidnamedinputelement. In this way, any form submissions done on the frontend will also result in the previewed Customizer state being persisted in the response.