code-snippets icon indicating copy to clipboard operation
code-snippets copied to clipboard

[Feature Request] Expose snippet Import/Export as endpoints in WP REST API

Open damion-add-on-depot opened this issue 4 years ago • 2 comments

First off, thank you all for creating an awesome plugin.

The only thing it's really lacking is the ability to seamlessly integrate snippets into a custom dev workflow.

Currently, users have to manually import and export snippets from the admin interface.

However, if that functionality were exposed as a series of endpoints under the WP REST API then developers will be able to integrate snippets into their own workflows.

For example, a developer might prefer to write their code locally using a different IDE and store it in a github repo. But they'd either have to copy-paste the code to the WordPress editor or use the import/export options from the snippets menu. With import/export exposed as REST API endpoints that process can be automated as part of a developer's tool-chain.

Any plans to implement this? Would you be open to contributors making pull requests with this feature?

damion-add-on-depot avatar Jan 11 '21 19:01 damion-add-on-depot

In addition to import / export, would be nice to have activate and deactivate as REST endpoints and a wp cli interface into all of those would be a big boon as well.

pjv avatar Aug 06 '21 16:08 pjv

We're definitely planning on WP-CLI and REST API support in future releases. It's going to come after we get the cloud sync support up-and-running, but it's something I am personally excited to implement. Hopefully we'll be able to support all of the major operations (activating, deactivating, creating, editing, deleting, exporting, importing, executing, etc) from these interfaces.

sheabunge avatar Jul 05 '22 09:07 sheabunge