pixelmodifier
Forum Replies Created
-
Hi, adding
kadence/pane
to allowed blocks fixed issue. Thanks for help!Hello,
Limiting blocks works with snippet I used before and with sample you provided.
Problem is still accordion block. When I limit Gutenberg blocks, then accordion block is not working correctly.
It is possible to create accordion only with 2 elements (default amount). Trying to add more with + button from editor, it doesnt add new elements. If I don’t limit Gutenberg blocks, then accordion block works properly.
Hi and thanks for the answer! I tested adding following snippet two different ways. Firstly added snippet directly to the custom theme and then tryed with WPCode Lite plugin to WordPress default 2024 theme and set location to run ‘admin only’. Both game same result.
add_filter( 'allowed_block_types_all', 'allowed_block_types', 10, 2 );
function allowed_block_types( $allowed_blocks, $editor_context ) {
$allowed_blocks = [
'core/heading',
'core/paragraph',
'kadence/accordion'
];
return $allowed_blocks;
}Demo you showed was excatly the issue, but I think in your demo video code snippet isn’t working correctly, because in video I see all available blocks too in your editor (you should only see allowed blocks in editor :/) and accordion block is working correctly, when other Kadence Blocks are around.
Did you run snippet in editor only?