Make WordPress Core

Changes between Version 3 and Version 4 of Ticket #59131, comment 10


Ignore:
Timestamp:
08/18/2023 10:44:00 PM (21 months ago)
Author:
azaozz
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #59131, comment 10

    v3 v4  
    11Sorry but to me it seems that both of these filters are mostly useless considering that there already are `pre_render_block`, `render_block_data`, and `render_block_context` filters. Could you please provide some practical examples where and how they can be used?
    22
    3 In addition, looking at the proposed `do_blocks_pre_render`: it filters the output from `WP_Block_Parser::parse()`. However `WP_Block_Parser::parse()` is used in several places in core, for example in templates. If such filtering makes sense wouldn't it be better to filter the output from the parser in the actual parser? I.e. add a filter on the return value in `WP_Block_Parser::parse()`.
     3In addition, looking at the proposed `do_blocks_pre_render`: it filters the output from `WP_Block_Parser::parse()`. However `WP_Block_Parser::parse()` is used in several places in core, for example in templates. If such filtering makes sense wouldn't it be better to filter the output from the parser in the actual parser? I.e. add a filter on the return value in `WP_Block_Parser::parse()` or in the `parse_blocks()` helper function.
    44
    55Looking at the proposed `do_blocks_post_render` in `do_blocks( $content )`. How is that different than `the_content` filter?