[wp-trac] [WordPress Trac] #65331: PHP-only block - postId, context and REST
WordPress Trac
noreply at wordpress.org
Sat May 23 07:05:30 UTC 2026
#65331: PHP-only block - postId, context and REST
--------------------------+-----------------------------
Reporter: seindal | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Editor | Version:
Severity: normal | Keywords:
Focuses: |
--------------------------+-----------------------------
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.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/65331>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list