block-developer-cookbook icon indicating copy to clipboard operation
block-developer-cookbook copied to clipboard

Block context

Open ryanwelcher opened this issue 2 years ago • 0 comments

Creating a block that is aware of the postType and postID that it's inserted on and can provide context to it's children.

Post Picker.

  • Custom block with InnerBlocks that only allows custom inner block that displays item Title.
  • Inner block is a search field for whatever content type is chosen
  • Main block gets the default post type from global context.
  • Main Provides the chosen post type to the inner blocks

Tags

Block Context, InnerBlocks, data layer

ryanwelcher avatar Aug 18 '23 18:08 ryanwelcher