updating with new block enqueuing

This commit is contained in:
Antoine M 2023-10-19 17:25:37 +02:00
parent 0a3491fb8b
commit 0feed096a5

View File

@ -52,7 +52,14 @@ function create_block_multiblocks_block_init()
register_block_type(__DIR__ . '/blocks/chapitrage-thematique/build');
register_block_type(__DIR__ . '/blocks/timeline/build');
register_block_type(__DIR__ . '/blocks/staff-list/build');
register_block_type(__DIR__ . '/blocks/section-titling/build');
// CONTAINERS (STATIC)
register_block_type(__DIR__ . '/blocks/grey-box/build');
register_block_type(__DIR__ . '/blocks/white-box/build');
// CHILDREN (STATIC)
register_block_type(__DIR__ . '/blocks/monoblock/build'); // — ALLOWED IN GREYBOX / WHITE BOX
// register_block_type(__DIR__ . '/blocks/_starterNested/build');
}
@ -164,6 +171,22 @@ function homegrade_allowed_block_types($allowed_blocks, $editor_context)
}
function wpdocs_allowed_block_types($block_editor_context, $editor_context)
{
if (!empty($editor_context->post)) {
return array(
'core/paragraph',
'core/heading',
'core/list',
);
}
return $block_editor_context;
}
// add_filter('allowed_block_types_all', 'wpdocs_allowed_block_types', 10, 2);
/* -------------------------------------
POST TYPE TEMPLATES
-------------------------------------*/