WordPress.org

Make WordPress Core

Ticket #49442: 49442.diff

File 49442.diff, 586 bytes (added by dougwollison, 14 months ago)

Proposed 'parse_blocks' filter on parse_blocks() return value.

  • wp-includes/blocks.php

    diff --git a/wp-includes/blocks.php b/wp-includes/blocks.php
    index a07e51f959..891386ce40 100644
    a b function parse_blocks( $content ) { 
    518518        $parser_class = apply_filters( 'block_parser_class', 'WP_Block_Parser' );
    519519
    520520        $parser = new $parser_class();
    521         return $parser->parse( $content );
     521
     522        /**
     523         * Filter the collection of parsed blocks.
     524         *
     525         * @since 5.?.?
     526         *
     527         * @param array[] $blocks Array of parsed block objects.
     528         */
     529        return apply_filters( 'parse_blocks', $parser->parse( $content ) );
    522530}
    523531
    524532/**