Transforming a Single WordPress Block into a Block Variation with InnerBlocks

One minor victory in the latest updates to my RSVPMaker plugin was figuring out a block transform to turn a single block, RSVPMaker Upcoming, into a variation on the Query Loop block.

With this configured, the Transform To options displayed when you click on the calendar icon in the button bar include Query Loop — complete with a preview of what the transformed block will look like with my defaults applied.

The tricky part was turning a single block (rsvpmaker/upcoming) into a version of the Query Loop (core/query) with preset InnerBlocks for the Post Template (a container for the blocks representing the post title and other elements, in this case including the event date and time).

The official Transforms documentation covers a number of use cases, including a scenario where you are transforming one block that contains InnerBlocks to another — you take the InnerBlocks object passed in by the source and pass it in to the createBlock call for “Transform to” operation. In my case, I needed to create the blocks from scratch.

More Headlines

“The Wide World of Hybrid Toastmasters,” Toastmasters Magazine

Digital Transformation and IT Careers Articles for The Enterprisers Project

Unsubscribe rsvpmaker@example.com from this list https://davidfcarr.com/?rsvpmail_unsubscribe=rsvpmaker@example.com&rmail=1

Our mailing address is:

Copyright (C) 2024 David F. Carr All rights reserved.



Unsubscribe rsvpmaker@example.com from this list https://davidfcarr.com/?rsvpmail_unsubscribe=rsvpmaker@example.com&rmail=1
Our mailing address is:

Copyright (C) 2024 David F. Carr All rights reserved.