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
4844bcbe
Commit
4844bcbe
authored
2 years ago
by
agata
Browse files
Options
Downloads
Patches
Plain Diff
blocks allowed test
parent
9c6d7264
No related branches found
No related tags found
No related merge requests found
Pipeline
#37469
passed
2 years ago
Stage: release
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ai-blocks.php
+11
-12
11 additions, 12 deletions
ai-blocks.php
with
11 additions
and
12 deletions
ai-blocks.php
+
11
−
12
View file @
4844bcbe
...
...
@@ -8,18 +8,17 @@
* 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'
,
);
}
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
);
return
$block_editor_context
;
}
add_filter
(
'allowed_block_types_all'
,
'
blacklist_blocks'
);
add_filter
(
'allowed_block_types_all'
,
'
wpdocs_allowed_block_types'
,
10
,
2
);
This diff is collapsed.
Click to expand it.
agata
@agata
mentioned in commit
bf785019
·
2 years ago
mentioned in commit
bf785019
mentioned in commit bf7850193614f1cd317e053a593f3b6034f6967b
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