Make WordPress Core

Opened 4 weeks ago

Last modified 4 weeks ago

#65628 new enhancement

PHP-only blocks: in-canvas editing

Reported by: priethor Owned by:
Priority: normal Milestone: Awaiting Review
Component: Editor Version: trunk
Severity: normal Keywords: has-patch has-unit-tests
Cc: Focuses:

Description

WordPress 7.0 introduced PHP-only block registration through supports.autoRegister. These blocks currently use a render_callback, so the editor displays a server-rendered preview rather than editable blocks, and can't be editable in-canvas.

This ticket tracks the WordPress Core changes for the in-canvas editing of PHP-only blocks, in particular the pattern-based approach explored in Gutenberg PR #80182:

  • It lets a PHP-only block provide a pattern instead of a render callback, so its content can be edited directly in the canvas.
  • Patterns stay synced by default, and block authors choose which fields can be edited on each instance through pattern overrides.
  • A PHP-only block can provide either a render_callback or a pattern. If both are registered, WordPress reports incorrect usage and uses the pattern.

Change History (1)

#1 @priethor
4 weeks ago

  • Keywords has-patch has-unit-tests added; needs-patch removed
Note: See TracTickets for help on using tickets.