@morgan-estes Great solution but it i think it should be better to add_filter in else so the next block or content gets filter with WPAUTOP
/**
* Try to disable wpautop inside specific blocks.
*
* @link https://wordpress.stackexchange.com/q/321662/26317
*
* @param string $block_content The HTML generated for the block.
* @param array $block The block.
*/
add_filter( 'render_block', function ( $block_content, $block ) {
if ( 'acf/featured-pages' === $block['blockName'] ) {
remove_filter( 'the_content', 'wpautop' );
} elseif ( ! has_filter( 'the_content', 'wpautop' ) ) {
add_filter( 'the_content', 'wpautop' );
}
return $block_content;
}, 10, 2 );
Related Posts:
- How can I put a custom meta box above the editor but below the title section on the edit post page?
- How to make a script load after Custom Block is loaded in the editor?
- Add custom fields within meta box class “on the fly”
- Disable the visibility options in WP
- How to enable the tag in WordPress posts and pages
- How to add button to post page WordPress 5.x
- How to replace default icon on “Add Media” button?
- Why is the new Gutenberg editor so narrow, and how to make it wider?
- Why could I not change the icon of the default Add media button that I added into the toolbar of TinyMCE?
- can’t see all pages in dashboard (can only see 3) /wp-admin/edit.php > 500 error
- WordPress Post Editor Toolbar Missing
- How to add “Check all” to Edit post page in WP?
- How to get value of selected page template in Gutenberg editor?
- Is it possible to “comment out” text in a post?
- Make substitute in all WordPress posts
- editor-style.css Functionality
- Show box only on edit post
- Adding a tooltip above Categories postbox in Post Editor
- YouTube Video autoplay
- Adding content in Gutenberg editor
- How can I define a max width for content in post editor based on a page template?
- wp_update_post() blank screen
- Post editor loads empty
- Word count not accurate – potential bug
- Prepare content from a different CMS/WYSIWYG to the WordPress editor
- find out reason of “Updating failed” in Post-editor
- Notion-like editing and layout with a convenient freeform collaborative editor in WordPress? [closed]
- Admin sidebar overlapping on editor when saving draft
- How can I remove the editor from the ‘main posts page’?
- Theme post editor does not have Visual & Html tabs and all buttons?
- Confirmation message when submitting post for review
- Cannot read properties of undefined (reading ‘show_ui’) Error on WordPress Post Editor
- How to Batch Convert Gutenberg post to Classic post?
- Making custom meta box required (with error message if not filled in) on Gutenberg
- How do I trigger the sidebar reveal for my sidebar plugin in the Gutenberg editor?
- Hide Some Categories in Post Editor
- < ! - - more - - > tag not working
- Block editor: content resets to the previous state in “Edit as HTML” by clicking somewhere outside of the editing window
- Images are not shown in the post editor
- How can I (for the long term) style the classic editor’s TEXTAREA?
- how can i add extra parameter to edit post link?
- Empty paragraphs around figure and figcaption tags when using markdown
- How can I implement a simple post editor?
- How to retain last modification date on draft edit
- wordpress 6.2 is alignfull and lignwide removed?
- Removing Default Panels From Gutenberg Document Setting Panel (sidebar)
- How can I remove the wp_autop filter from a shortcode block in a block theme page template (twenty twenty-three)?
- WordPress Editor Missing Padding and Background Color?
- What hook runs wpautop on template content?
- Gutenberg editor styles not applied
- Using Glide.js in custom Gutenberg block
- Patterns are not displaying in Custom Gutenberg editor component to render gutenberg everywhere
- remove empty paragraphs from the_content?
- Check what Gutenberg blocks are in post_content
- Enable Gutenberg on custom post type
- Switch between Visual and HTML tab freely
- How would one modify the filtering Gutenberg applies to pasted content?
- Load CSS/Javascript in frontend conditionally if block is used
- Gutenberg: Is there a way to know if current block is inside InnerBlocks?
- How to extend the gallery block in Gutenberg?
- Remove inline linking tool
- Custom taxonomy terms not showing as list Gutenberg Editor
- Where can I find the Gutenberg block icons?
- check if Gutenberg is currently in use
- Add pre-publish conditions to the block editor
- Unable to select an old date in wordpress
- How to add a custom CSS class to core blocks in Gutenberg editor?
- How to filter or remove default panels in Gutenberg PrePublish Panel
- Trigger Javascript on Gutenberg (Block Editor) Save
- Running Gutenberg React in Development Mode
- How would I get a taxonomy/category list inside a Gutenberg block?
- Deactivate Gutenberg tips forever – not Gutenberg
- Force category choice before creating new post?
- How does Gutenberg handle translations in React?
- Set default image link target in Gutenberg image block
- Removing panels (meta boxes) in the Block Editor
- Gutenberg editor add a custom category as wrapper for custom blocks
- Gutenberg – remove / add blocks with custom script
- Syntax highlighting for post/page editor [closed]
- No filter of code on switch from html to visual editor, how?
- WordPress adding scaled images that don’t exist (1536×1536 and 2048×2048)
- How to remove the core embed blocks in WordPress 5.6?
- Are there Gutenberg container blocks?
- How to hide specific Gutenberg blocks settings from users
- Add To Gutenberg Sidebar
- What are all the query parameters for getEntityRecords?
- How to detect the usage of Gutenberg
- How to use PanelColorSettings in custom Gutenberg block?
- show classes as dropdown in guttenberg`s additional css classes input box
- Integrate Gutenberg as a Standalone App
- Creating conditional blocks for WordPress Gutenberg
- Help Unregistering a Core Block Type in Gutenberg
- How to use wp.hooks.addAction() in React JS/Gutenberg?
- How to edit a post meta data in a Gutenberg Block?
- How To Have Two Gutenberg Editors On One Post?
- Gutenberg add a custom metabox to default blocks
- Gutenberg disallow certain custom blocks but keep all core blocks?
- add button to post edit page when post_status=publish
- Remove wpautop from shortcode content / remove whitespace in buffering
- Validation error: Extending Gutenberg gallery block