Skip to content

De-register WP Core filters when running the Gutenberg Plugin #62713

Open

Description

What problem does this address?

This comes out of assisting with #58855 (Footnotes).

The Gutenberg build script currently registers the various functions in the block library to replace their WordPress Core equivalent (ie, the version that has been committed to WordPress-Develop).

While working on the Footnotes CPT issue, I noticed that the WordPress Develop hooks aren't de-registered so will continue to run in addition to the Gutenberg hooks. Generally this is fine, if a little sub-optimal, as the Gutenberg hooks usually replace the markup generated by the WP-Dev hooks.

However, in some cases it can lead to unexpected behaviour when registering features for a block. As an example, modifying register_block_core_footnotes_post_meta() in Gutenberg will still run the unchanged code in WordPress-Develop.

What is your proposed solution?

Modify the build script to de-register the core block when running the plugin.

This will ensure any changes to a block's PHP file are reflected in the execution without interference from WordPress-Develop.

cc @gziolo @youknowriad (PR incoming but it's broken)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions