Overview of WordPress Block Internals?

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
  • #5795

    I’ve been learning how to develop blocks, but I’m curious about the WordPress side of the implementation. I can reverse-engineer it from the source code, but does someone have a pointer to a good overview of the implementation? Thanks in advance.


    If you want to see some source code, go to our Github repo for C9 Blocks + the C9 Starter Theme. We’ve built four themes and plenty of custom client themes with that starter, and the blocks plugin has a ton of examples of how we made more complex blocks like a grid.

    ACF for making custom blocks is okay, but you’re not getting that same visual backend that matches the frontend with it, so I always prefer making native blocks.



    You can get all of our stuff emailed to you including Github repos for our plugins if you sign up for our [beta list](https://www.covertnine.com/form/c9-beta).

    We learned most of what we needed from this guy’s courses since he was one of the first I found with decent tutorials.



    I think this might be what you are looking for.



    At its simplest:

    1) Block Editor = React + Gutenberg Data module (which is Redux with a twist) that creates the editor interface

    2) The “save” function of a block wraps the block’s markup + content into a html comment and saves it, along with all the post’s other blocks, into that post’s post_content field in the wp_posts table of your site’s database.

    3) The theme’s templates strip out the html comments and then render the saved markup + content in the loop.


    – The official docs are essential yet sometimes out of date and often obtuse.

    – I’ve learned a lot from reading [https://richtabor.com/](https://richtabor.com/)

    – Conversations on the github repo are illuminating, especially useful when you’re working on a narrow problem. Checking out the “projects” is more fun [https://github.com/WordPress/gutenberg/projects](https://github.com/WordPress/gutenberg/projects)

    – A lot of talks here, some good, some already out of date: [https://wpblocktalk.wordpress.stream/](https://wpblocktalk.wordpress.stream/)


    I know ACF has a framework for developing blocks.

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.