Skip to content

Pass Rendering Context to Server-Side Render Callback #9510

@fklein-lu

Description

@fklein-lu

When using PHP to render blocks, it is useful to know in which context the rendering happens. A common scenario for this is to have slightly different output in the editor and the front end.

Currently there is no good way to determine in the PHP layer whether the render happens in the editor or on the front end.

I propose to pass an additional context argument to the callback function for rendering dynamic blocks.

It is possible to differentiate the two by other means, but these are rather inelegant.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions