Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
ai-mu-plugins
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Noblogs
ai-mu-plugins
Commits
9c6d7264
Commit
9c6d7264
authored
2 years ago
by
agata
Browse files
Options
Downloads
Patches
Plain Diff
manage blocks
parent
f7cdc5ea
No related branches found
No related tags found
No related merge requests found
Pipeline
#37464
passed
2 years ago
Stage: release
Changes
1
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ai-blocks.php
+25
-0
25 additions, 0 deletions
ai-blocks.php
with
25 additions
and
0 deletions
ai-blocks.php
0 → 100644
+
25
−
0
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'
);
This diff is collapsed.
Click to expand it.
agata
@agata
mentioned in issue
noblogs-composer#93 (closed)
·
2 years ago
mentioned in issue
noblogs-composer#93 (closed)
mentioned in issue noblogs-composer#93
Toggle commit list
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment