Block inserter not being displayed when WP filter allowed_block_types_all is used (Core 6.6.2) #66679
Open
3 of 6 tasks
Labels
[Feature] Inserter
The main way to insert blocks using the + button in the editing interface
Needs Testing
Needs further testing to be confirmed.
[Type] Bug
An existing feature does not function as intended
Description
Hi,
We are using ACF to create the blocks on our websites. To remove the default blocks we are also using the filter allowed_block_types_all.
But after upgrading WP Core to 6.6.2 the block inserter below the blocks is no longer displayed after inserting the first block. (Please see the screenshot section)
When I remove the allowed_block hook the inserter is displayed again but a different (default?) version:
The array coming out from allowed_block_types_all filter after removing default blocks looks something like this:
Digging through the code in block-editor.js I was able to find the condition in the function Items() that might be problematic:
Just returning true here makes the block inserter to display properly again:
Returning true on either side of the && in the highligted condition does not seem to work. Both sides need to return true.
Note:
I have tried downgrading ACF but still same issue. Using WP Core 6.5.5 is working as usual.
I hope that this is enough information to backtrack from here. Thanks in advance!
Step-by-step reproduction instructions
Screenshots, screen recording, code snippet
Environment info
Environments:
Wordpress 6.6.2
Plugins:
Advanced Custom Fields PRO 6.3.9
Theme
Custom theme
Browsers:
Edge - Version 130.0.2849.56
Chrome - Version 130.0.6723.71
Firefox - Version 122
Please confirm that you have searched existing issues in the repo.
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Please confirm which theme type you used for testing.
The text was updated successfully, but these errors were encountered: