WP Gutenberg – How to parse simple images?

When you return $post->post_content you’re returning the raw content from the database. Things like shortcodes, dynamic blocks and responsive image markup will not exist in the content. To prepare content for output you need to run it through the the_content filter: ‘content’ => apply_filters( ‘the_content’, $post->post_content ), That being said, there is already an endpoint … Read more

Use a custom block inside another custom block

Finally,I have found a solution. I can pass my custom block to the InnerBlocks inside a template prop. const TEMPLATE = [ [ “core/columns”, {}, [ [ “core/column”, {}, [[“custom/Block A”, { url: “this is a url” }]], ], [ “core/column”, {}, [[“core/paragraph”, { placeholder: “Enter side content…” }]], ], ], ], ]; <InnerBlocks template={TEMPLATE} … Read more

Best approach to change mobile background image and adding its class

As I am extending core/group block to add option for setting different image for smaller displays I used render_block_core/group filter to add style tag. I am already adding data-mobile-background-image to each group for its mobile view background image so there is no need for updating it through ID as suggested by Tom J Nowell. Final … Read more