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

Ensure post sections are added for posts that are part of a changeset #336

Open
westonruter opened this issue Dec 22, 2016 · 0 comments
Open
Assignees

Comments

@westonruter
Copy link
Contributor

Something like this (props @PatelUtkarsh) should be included in the plugin:

/**
 * Pre load snapshot data in customizer
 * When user saves a new snapshot and reloads customizer with that snapshot s/he should able to
 * see edited snapshot entity without searching it.
 *
 * @returns {void}
 */
component.preLoadSnapshotData = function preLoadSnapshotData() {
	api.bind( 'ready', function() {
		var settingKeys = _.keys( JSON.parse( api.previewer.query().customized ) );
		_.each( settingKeys, function( id ) {
			if ( ! /^post\[(.+?)]\[(\d+)]$/.test( id ) ) {
				return;
			}
			api.Posts.addPostSection( id );
		} );
	} );
};
@mohdsayed mohdsayed self-assigned this Apr 4, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants