WordPress.org

Make WordPress Core

Opened 3 months ago

Closed 5 days ago

Last modified 5 days ago

#53596 closed enhancement (fixed)

Pass the block instance to the `render_block` filters

Reported by: johnbillion Owned by: johnbillion
Milestone: 5.9 Priority: normal
Severity: normal Version: 5.5
Component: Formatting Keywords: has-patch
Focuses: Cc:

Description

When using the render_block and render_block_{$this->name} filters I wanted to access the WP_Block instance to access its properties, specifically the available_context and context properties. These aren't accessible within these filters because the WP_Block instance isn't passed in.

Change History (3)

This ticket was mentioned in PR #1467 on WordPress/wordpress-develop by johnbillion.


3 months ago

  • Keywords has-patch added; needs-patch removed

#2 @johnbillion
5 days ago

  • Owner set to johnbillion
  • Resolution set to fixed
  • Status changed from new to closed

In 51841:

Formatting: Pass the block instance as a parameter to the render_block filters.

This allows filters to access properties and methods on the block instance.

Fixes #53596

Note: See TracTickets for help on using tickets.