customize_changeset_branching WordPress Filter Hook
The customize_changeset_branching hook is used to modify the way that changesets are stored in branches. By default, changesets are stored in a single branch, but this hook allows you to specify a different branch for each changeset. This can be useful for organizing your changesets, or for keeping track of different versions of your site.
apply_filters( 'customize_changeset_branching', bool $allow_branching , WP_Customize_Manager $wp_customize ) #
Filters whether or not changeset branching is allowed.
Description
By default in core, when changeset branching is not allowed, changesets will operate linearly in that only one saved changeset will exist at a time (with a ‘draft’ or ‘future’ status). This makes the Customizer operate in a way that is similar to going to "edit" to one existing post: all users will be making changes to the same post, and autosave revisions will be made for that post.
By contrast, when changeset branching is allowed, then the model is like users going to "add new" for a page and each user makes changes independently of each other since they are all operating on their own separate pages, each getting their own separate initial auto-drafts and then once initially saved, autosave revisions on top of that user’s specific post.
Since linear changesets are deemed to be more suitable for the majority of WordPress users, they are the default. For WordPress sites that have heavy site management in the Customizer by multiple users then branching changesets should be enabled by means of this filter.
Parameters
- $allow_branching
(bool)Whether branching is allowed. If
false
, the default, then only one saved changeset exists at a time.- $wp_customize
(WP_Customize_Manager)Manager instance.
Source
Changelog
Version | Description |
---|---|
4.9.0 | Introduced. |