Closed HardeepAsrani closed 4 years ago
I think that is an excellent idea.
I'll try to work and send a PR. You can review and let me know where to improve the code. OOP-PHP isn't my strongest skill. 😄
Here's how it will work: https://www.loom.com/share/8f0ee1e7fb854f36a9caa0eedbf134d3
@justintadlock sending the code your way in moments. :)
Wow, that was fast! I'll want to study the code a bit, but it looks good with a quick scan. I'll probably merge when I can sit down with this a bit, then set up my normal script build system for familiarity.
I didn't really take much of an OOP approach with the PHP code though because I was just knocking out something basic very fast to kick-start this project.
Yea, fortunately, I was able to update post type using Backbone so didn't need to write much code.
The plugin seems great. One thing which I think will make it even better is to allow people to create new block patterns without leaving the editor.
Code will be similar to we use in our plugin: https://wordpress.org/plugins/blocks-export-import/
So when people make new blocks and want to turn it into a pattern, they can select the block(s) and click on "Add to Block Patterns," similar to how our plugin or Reusable Blocks work.
Once the user clicks on it, they will get a Popup to add the name of the block pattern and it will be saved as Block Patterns post-type.
What do you think @justintadlock?