Skip to content

Epic: Block Hooks Features for WP 6.5 #54904

@ockham

Description

@ockham

Block Hooks have been formerly know as Auto-inserting Blocks.

Plans for WordPress 6.5

Other

  • Performance: Try refactoring get_hooked_blocks() to check impact wordpress-develop#5399
  • Block Hooks: Update the compatibility layer #58468 (Backport filter mechanism to Gutenberg.)
  • Add higher-level test coverage (integration and/or e2e).
  • Respect template locks.
    • I need to read up on them, but I imagine we shouldn't auto-insert into a locked template? 😬
  • Respect "multiple": false.
    • Blocks can stipulate they only be inserted once. Auto-insertion should probably respect that; @nerrad made a PoC PR during WCUS Contributor Day: Rough POC of respecting "supports multiple" in the auto-inserted block metadata #53925
    • Some prior discussion: "It could also be that autoInsert works upon the first encountered block of the specified type, so it doesn't get repeated if there are multiple navigation blocks in a page. Or maybe this is also a flag like useOnce."
    • This still doesn't give control over which navigation block that is (but will default to the first one encountered); we might want a mechanism to select that, too. See next item for a somewhat related problem.
    • Finally, note that the multiple field was originally introduced for a post editor context; it isn't really well-defined in a template/Site Editor, as @gziolo has observed.
  • Notify user that there’s a new auto-inserted block available (after activating a new plugin that includes that block).
    • In the editor, or even wp-admin? Needs design.
    • How it could be implemented: Make list of registered blocks before and after plugin activation, compare; see if newly added block.json has autoInsert field? (Doesn't cover blocks that are auto-inserted programmatically.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Feature] BlocksOverall functionality of blocks[Type] IterationScoped iteration of an effort from a tracking issue or overview issue ideally for a major release.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions