Skip to content
Snippets Groups Projects
Commit bf785019 authored by agata's avatar agata
Browse files

Revert "blocks allowed test"

This reverts commit 4844bcbe.
parent 4844bcbe
Branches
No related tags found
No related merge requests found
......@@ -8,17 +8,18 @@
* Author URI: https://autistici.org
**/
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;
function blacklist_blocks( $allowed_blocks ) {
// get all the registered blocks
$blocks = WP_Block_Type_Registry::get_instance()->get_all_registered();
// then disable some of them
unset( $blocks[ 'core/embed' ] );
// return the new list of allowed blocks
return array_keys( $blocks );
}
add_filter( 'allowed_block_types_all', 'wpdocs_allowed_block_types', 10, 2 );
add_filter( 'allowed_block_types_all', 'blacklist_blocks' );
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment