3

I have been to GitHub, but the documentation there is not what I'm looking for. I'm looking more this:

<!-- wp:post-featured-image /-->
<!-- wp:post-title /-->
<!-- wp:spacer {"height":40} -->
<!-- wp:post-content /-->
<!-- wp:spacer /-->
<!-- wp:group /-->
<!-- wp:template-part {"slug":"footer"} /-->

or is it just a matter of deduction: the name of the element concatenated with the wp comment structure:

<!-- wp: plus post-title plus optional attributes {tag: something} plus /-->

I've searched and can't find it if it exists.

1 Answer 1

4

There's no definitive list that I'm aware of. If you want to get the markup for a block the only reliable way to do that is to insert it into the editor and then copy the result to the clipboard.

You cannot assume that all blocks are "<!-- wp: plus post-title plus optional attributes {tag: something} plus /-->", as many blocks also include HTML that they depend on. For example, the image block looks like this:

<!-- wp:image {"id":1934,"sizeSlug":"full","linkDestination":"none"} -->
<figure class="wp-block-image size-full"><img src="https://example.test/wp-content/uploads/2023/01/image-1.jpg" alt="" class="wp-image-1934"/></figure>
<!-- /wp:image -->

Just using the <!-- part would not be sufficient.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.