Make WordPress Core

Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#53596 closed enhancement (fixed)

Pass the block instance to the `render_block` filters

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


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 years ago

  • Keywords has-patch added; needs-patch removed

#2 @johnbillion
3 years 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.