You can check if the current theme supports Gutenberg blocks inside your function
function amb_allowed_block_types( $allowed_blocks ) {
if(! current_theme_supports('wp-block-styles') ){
return $allowed_blocks;
}
return [
'core/paragraph',
'core/image',
'core/heading',
'core/gallery',
...
Related Posts:
- How would one modify the filtering Gutenberg applies to pasted content?
- Gutenberg: Is there a way to know if current block is inside InnerBlocks?
- How to add a custom CSS class to core blocks in Gutenberg editor?
- How can I extend the Gutenberg table block transform to allow colspans/rowspans on pasted table elements?
- Changing text within the Block Editor
- Remove left alignment option in core/image block
- Changing Gutenberg / WP block editor width only on pages, not posts or other taxonomies
- Filter Gutenberg Blocks Content
- How do I replace a render_callback function for a block?
- How can I filter block registration based on post-type? (Block alignment settings)
- Gutenberg disable the “block” tab in right sidebar
- How to change the order of HTML output of a core block?
- Gutenberg – Add align controls to a custom block
- Can the wordpress color palettes by changed through Javascript?
- Inline Styles on all native blocks
- How to link the whole list item in Gutenberg’s latest posts block?
- add_filter(allowed_block_types) -> adding core/paragraph bugs Gutenberg editor
- Set default terms for new posts / CPTs
- Detect when gutenberg editor title is available in Dom after editor load
- Gutenberg Block – Post Featured Image Filter Hook
- Set default value for “Additional CSS class(es)” for specific block types
- How to hide/remove GhostKit component panel in gutenberg block inspector
- Filter for author list in gutenberg core editor
- How to optionally append components to the output of a gutenberg block?
- Problem width wp_insert_post_data and Gutenberg block editor
- WordPress Gutenberg core/heading block (wp-block-heading)
- Changing the category for existing Gutenberg blocks
- How to add lazy field in content endpoint using Gutenberg blocks
- How to add custom HTML attribute to reusable block div in WordPress admin
- How to change this WP logo and posts url in block editor?
- Add custom options to the wplink dialog
- How to show page content in feed?
- Insert new element to array with add_filter
- remove_filter( ‘the_content’, ‘wpautop’ ); only for certain post types
- How can I add information underneath the user’s name on the users.php page?
- Is calling function_exists() faster or slower that apply_filters()
- Filtered query_vars becomes global. Why does this work?
- Alter only the page title, not the post titles within
- Load different template file when condition met?
- Too many actions/filters!
- How can override a add_filter of a plugin?
- Adding Filter Conditionally Per Page ID
- Nested calls the the_content filter
- How to change domain used when pinging sites
- Extend core block attributes in post content
- Is it possible to track down Actions and Filters?
- Return a custom value in a function added to an action hook
- Adding id and class to the search input in WordPress search form
- Multiple filters for wp_get_archive
- Filter and modify entry-footer link in twentyseventeen
- Function the_content not working
- Break out of wordpress filter
- Are there actions or filters I can use for Ajax calls?
- Add filter problems
- Where is the content cache when using apply_filters(‘the_content…?
- How to filter for user registration, be able to throw error message
- No ‘Access-Control-Allow-Origin’ header is present [closed]
- How to prepare WordPress Rest data for Preview Changes?
- How to validate recaptcha on comments form?
- Contact Form 7: Make field required after checkbox is checked
- Customize title, description and focused keyword [closed]
- Is there any filter to trigger as soon as media is uploaded to post or page?
- wp_mail works with add_action(‘save_post’, …) but not an ajax action
- add_filter with retrieve_password_message() not working in plugin, but works in functions.php
- Add a div of content within the_content after a certain block
- Is it possible to put the add-filter()-hook into a function?
- How can I return shortcode output to the top of the content?
- separate categories with comma and srounded by single quote
- Filter for when the post is updated
- Prevent add_filter being applied to wp-admin pages
- Filter a pluggable function
- apply_filters(‘get_the_content’, $content) + Except
- Filter everything from content except output of a shortcode
- Filter have_posts()/ the_post()
- Is there a way to globallly apply esc_html( … ) to all inputs and anchors to filter out XSS markup?
- Filter get_page_by_path()
- Handle multiple parameters in filter
- How to add filter in custom rss feed
- Want to use wp_get_current_user() in query filter
- Apply wordpress filter checking category
- How To Get Search Term and Use in Function
- How to set a filter search for categories of blog posts in wordpress
- Filter the title to only affect the_title() template function
- How can I filter the comment action links so that I can display the actions links based on user capabilities?
- Adding link options in insert/edit link dialog window
- Modify Contextual Help
- how to use apply filter for Class?
- Modify WordPress search behaviour in backend?
- Re-order search results with posts_orderby filter and post meta value
- ‘the_content’ Filter delivers empty string with lengh (608)
- Testing requested query in pre_get_posts
- Output dynamic_sidebar_params in wp_head
- How to sort posts according to meta value?
- Modify WooCommerce email shipping text value
- Using Filters To Change Page Title
- remove_filter excerpt_more from a plugin class
- Replacing text using add_filter
- Background color and background image below element in Contact Form 7 – error tip [closed]
- Change password reqts with NO plugin without breaking resetpass link?
- How can I conditionally add the filter option_home?