Skip to content
GitLab
Explore
Sign in
Commits on Source (3)
add ai-blocks.php
· 8e24c77d
agata
authored
Sep 01, 2022
8e24c77d
Revert "add ai-blocks.php"
· f7cdc5ea
agata
authored
Sep 01, 2022
This reverts commit
8e24c77d
.
f7cdc5ea
manage blocks
· 9c6d7264
agata
authored
Sep 02, 2022
9c6d7264
Hide whitespace changes
Inline
Side-by-side
ai-blocks.php
0 → 100644
View file @
9c6d7264
<?php
/*
* Plugin Name: A/I - Add a denylist of gutenberg blocks
* Plugin URI:
* Description: Remove some block from editor
* Version: 0.0.1
* Author: Autistici/Inventati
* Author URI: https://autistici.org
**/
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'
,
'blacklist_blocks'
);