Make WordPress Core

Opened 6 hours ago

#65331 new defect (bug)

PHP-only block - postId, context and REST

Reported by: seindal's profile seindal Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Editor Keywords:
Focuses: Cc:

Description

If a PHP only block is registered with

'uses_context' => [ 'postId' ],

the context with the postID is delivered only on direct calls to the renderer (in the third argument to the render callback) during the initial rendering as the editor loads, but not when the renderer is invoked by the editor through the REST interface.

This seems inconsistent, and makes PHP only blocks less useful, as, in most cases, they cannot access the post being edited.

This is only an issued in the editor. The PHP-only blocks work as expected on the public side.

WP 7.0 selfhosted.

Change History (0)

Note: See TracTickets for help on using tickets.