In the functions.php file I added
add_filter( 'allowed_block_types_all', 'func_allowed_block_types' );
function func_allowed_block_types( $allowed_blocks ) {
return array(
'core/embed'
);
}
Then in my plugin I added this JS to the javascript file to enable only the embed blocks I wanted (Twitter, youTube and Vimeo)
wp.domReady( function() {
const allowedEmbedBlocks = [
'twitter','youtube', 'vimeo'
];
wp.blocks.getBlockType( 'core/embed' ).variations.forEach( function( blockVariation ) {
if (
allowedEmbedBlocks.indexOf( blockVariation.name ) === -1
) {
wp.blocks.unregisterBlockVariation( 'core/embed', blockVariation.name );
}
} );
} );
Related Posts:
- How to hide specific Gutenberg blocks settings from users
- Disable WordPress’ blogging functionality and disable ‘posts’
- Set Post Title to Read-only and Disable Permalink Slug Editor in Gutenberg
- How do I convert a mathematical Microsoft Word document to a WordPress blog post?
- widget should display post archive by year and on click also by month
- how to display full post with pagination on home page
- Get post from custom REST endpoint in Gutenberg
- blog page showing only first post
- Showing random content / pictures from earlier posts in a sticky post?
- How to share same post to multiple site in wordpress?
- How to show a full post, not just an excerpt
- How do I add a reusable block to a programmatically created post?
- Custom excerpt length filter doesn’t work
- How to get the post’s parent ID?
- Remove certain post-formats from showing in blog?
- How blog page in WordPress works : blog page retrieve first post ID
- Blog Posts in Custom Menu
- Why is my Blog Page ID == First Post ID?
- Add blogs to “Blogs i Follow” sidebar [closed]
- Choose whether to automatically add a taxonomy with the same name as the post
- Block Editor: Reset Reusable Blocks to last saved record
- Display posts from a different website on Genesis Responsive Slider
- How to Programmatically add an empty Block to every post on wordpress site?
- add new post default view
- Show certain posts in a LIST format that members have been granted access to
- Append class to posts page
- How to disable WordPress blog folder
- How could I change my Permalink from blog to custom structure? [closed]
- transition_post_status hook doesn’t have any POST data when publish with Gutenberg [closed]
- Single.php – Get Current Parent Category
- How to remove in-line style of WordPress’s post content only?
- Block editors annoying warnings
- WP move posts to different path
- Append ‘Continue Reading’ link if post length is more than 3 lines of text?
- older blog posts not showing in new theme
- Why won’t pagination work?
- WordPress Query Posts From Category Post on Static Page
- How to populate a select field with post titles/ids in a block
- How to create a page that shows the last 10 posts?
- Exclude post category in a blog page
- How to set a certain Custom Template to a Single Blog Post
- Sidebar on single.php not showing up
- Direct some posts to only appear on a specific page
- posts and cms and posts again
- Changing The Default Header POST Title and Description text by category in wordpress
- Get post publishing date from within custom HTML block
- Separate blog and reviews categories
- Indenting within a blockquote
- Override WordPress core post-template.php block template
- How to remove the ManageBlocksMenuItem in the ToolsMoreMenuGroup in the Gutenberg Editor?
- why my urdu text is not aligned properly when written in wordpress blog post?
- Older blog posts not showing up on WordPress
- WordPress React re-rendering to many times
- Pagination not give another posts
- “Blog pages show at most” in setting not working
- How to set a Post’s default visibility to ‘Private’ in Gutenberg?
- Sticky Post Doesn’t always work
- Post Image Gallery After Content Function messes with other content
- Embedding Post Editor Into External Site
- Add data attribute of post_id for Internal links
- Single Post Gallery Using Shortcode
- How can I create a ‘sub-blog’ which has its own sidebar on individual posts?
- blog post not accesible on click [closed]
- Auto inserted strange characters in wp post
- How to fix wordpress blog post error? Can anyone help to fix this issue?
- How to pull sticky post permalink inside php?
- WordPress empty page! what is wrong with this code?
- Moving Gutenberg content from one website to another (block media ids wrong?)
- Pagination Stops
- Bulk find & replace on WordPress posts/pages (minus image paths)
- Customizing a new page used for blog posts with Avada theme
- Blog featured images disappeared on my homepage
- Blog images not showing on homepage
- How to add a block to a category page?
- How to generate an HTML link automatically from URL in a users’ post
- Multiple Pages – Seperate blogs
- Word /blog/ in slug post, problems in CPT. Solutions?
- How to put the WordPress blog into theme
- Why the blog posts is not showing?
- Blog styling in SASS
- Link post to blog from a static page
- Hide first blog post in content and output it in widget
- How can I have the posts from one word press blog show on the presentation page of another word press site
- Page updates appear in Preview but not live version?
- new blog post does not appear in blog after publishing
- Posts don’t appear on the Blog page
- Wanting to apply different featured images for each post
- long blog post on self hosted wordpress blog not displayed
- WordPress Custom Theme: My site shows the same posts on Page 1 and Page 2 and so on [duplicate]
- Post only showing on homepage when Logged in – direct URL still working
- The page that displays Posts on homepage
- How to add a widget area between blog posts in Genesis Framework?
- How to save the same post in multiple blogs?
- Notify/check if the content of a custom gutenberg block has changed on save_post
- editPost without undo entry
- Permalink issue with new blog posts > getting 301 redirect
- Blog page shows the whole blog post instead of the excerpt or summary with the feature image only
- Preset category checkbox from URL parameter when creating new post
- Is it possible to create dynamic templates for block themes directly from the site editor?
- WordPress custom post_status after 6.6 version