Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid 'allowed_block_types' deprecated filter. #48

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from

Conversation

peterwilsoncc
Copy link

@peterwilsoncc peterwilsoncc commented Nov 26, 2024

In WordPress 5.8 the allowed_block_types filter was deprecated and replaced with the allowed_block_types_all filter.

The new filter takes the current editor's context as the second parameter, a WP_Block_Editor_Context object.

To remove the deprecation warnings thrown by this plugin in recent versions of WordPress, I've replaced the old with the new. As the second parameter's type has changed, I've created a wrapper for the existing function, filter_allowed_block_types() to account for backward compatibility for anyone extending this plugin (It's me, hi, I'm the problem, it's me).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant