Make WordPress Core


Ignore:
Timestamp:
01/20/2026 11:01:11 PM (3 months ago)
Author:
dmsnell
Message:

Build: Restore block parser in Core.

The work in [61438] for Core-64393 removed the block parser classes from Core, which caused numerous scripts to fail because they were missing. Conditional checks were added in [61492] which left WordPress in an inoperable state.

This patch restores the block parser in Core, in preparation for work to remove it from Gutenberg (in a separate patch).

Ironically, the files were removed because the new build was copying them over from Gutenberg and the intent was to avoid having two sources of truth, but this was previously the existing mechanism, so having done nothing to the parser files would have left the status quo. This patch removes the problems originally created by removing the files. They will not be copied from Gutenberg any more and the only source of truth will be Core.

Until removed from Gutenberg, because of the build changes, any changes made on the Gutenberg side will be lost unless manually copied over.

Developed in: https://github.com/WordPress/wordpress-develop/pull/10761
Discussed in: https://core.trac.wordpress.org/ticket/64521

Follow-up to [61438], [61492].

Props dmsnell, mcsf, mukesh27, youknowriad.
Fixes #64521.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/formatting.php

    r61492 r61504  
    52285228 */
    52295229function wp_pre_kses_block_attributes( $content, $allowed_html, $allowed_protocols ) {
    5230     // If the block parser isn't available, skip block attribute filtering.
    5231     if ( ! class_exists( 'WP_Block_Parser' ) ) {
    5232         return $content;
    5233     }
    5234 
    52355230    /*
    52365231     * `filter_block_content` is expected to call `wp_kses`. Temporarily remove
Note: See TracChangeset for help on using the changeset viewer.