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

Inject Customizer state into Ajax requests #65

@westonruter

Description

@westonruter

This goes hand-in-hand with #47. In order to preview sites that use a lot of JS and Ajax requests, the requests need to be Customzier-aware. We can accomplish this via jQuery Ajax prefilter. If on the frontend, we only need to inject the customzie_snapshot_uuid query param. In the Customizer Preview, we'll need to rewrite the requests to be POST and ensure the Customzier query vars are included: this has been demonstrated to work for the WP REST API, but it will not work in all cases. See implementation from Customize REST Resources which can be lifted: https://github.com/xwp/wp-customize-rest-resources/blob/84405f4312e22e956e86b6d17f0791d64e8de372/js/rest-resources-manager.js#L208-L265

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions