xwp / wp-customize-snapshots

Customize Snapshots WordPress Plugin
https://wordpress.org/plugins/customize-snapshots/
53 stars 16 forks source link

Export changeset to file #150

Open soderlind opened 7 years ago

soderlind commented 7 years ago

Do you plan to add the option to save a changeset to file (json / yml) ?

jeffpaul commented 7 years ago

@soderlind interesting request. What's the intent with a JSON/YML output file? To then load into a different WP instance? In which case, we'd need the ability to import as well it seems.

soderlind commented 7 years ago

Sure, import, into another site, is given :)

westonruter commented 7 years ago

It's a good idea and one that I've thought about. It is trivial to allow for exporting. The challenge comes with importing. In particular, conflict resolution will be very challenging when importing a changeset on a non-fresh site since any settings that contain IDs, like nav menus, nav menu items, and widgets instances will all be likely invalid when the changeset is imported.

soderlind commented 7 years ago

A start could be allowing import only for fresh sites.

westonruter commented 7 years ago

Yes, in fact we have the fresh_site option which could be used for this purpose.

soderlind commented 7 years ago

Yup, would be like having a tailored starter changeset.

westonruter commented 7 years ago

Yeah, and that's something we've talked about before in regards to starter content. A theme could be bundled with multiple starter content sets that the user could choose from, instead of only having one set of starter content. The difference between starter content and changesets is that the former is able to apply to an existing site since it will dynamically compute the IDs and create new objects, whereas the latter (changesets) have static setting IDs and wouldn't apply cleanly to an existing site. But yeah, they could apply to a completely fresh_site.