@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?
- Removing panels (meta boxes) in the Block Editor
- How to get “Additional CSS Class” for ACF Gutenberg block
- Change order/position of Gutenberg inspector control panel
- Gutenberg Inspector Controls
- serialize_blocks breaking html tags in content
- How to get the ToggleControl Gutenberg component working for a PHP Block
- How to use getBlockIndex
- Shortcode to Gutenberg-block: additional text on front-end and conditional display
- How to Parse an Array of Elements in Gutenberg Block
- How to Add extra option to Image Block Settings?
- Add a containing DIV to core Gutenberg blocks
- How can I add arbitrary `data-` attributes to a block’s `edit()` container?
- Classic editor showing in Gutenberg when creating a custom post type
- How to get Text Selection in WordPress Editor
- 404 in gutenberg autosave of a Custom Post Type with custom rest_namespace
- Notices in the Block Editor with multiple lines
- Where are the layout defaults in Twenty Twenty Two coming from?
- Can you edit WP gutenberg block css without a plugin?
- props.setAttributes results in “Maximum update depth exceeded.”
- Removing “wpautop” (auto tags) only on certain pages?
- Gutenberg: Dynamic rendering of RichText
- Checks when fetching data from multiple REST API endpoints in Gutenberg
- How to use apiFetch to get author information in Gutenberg properly?
- Gutenberg blocks error: Each child in a list should have a unique “key” prop
- Gutenberg – Remove add block button
- gutenberg message
- Add data to post edit page, when post is published
- What is the action or filter for adding information under the Permalink in Edit Post/Page?
- Problem with pagination block in Gutenberg
- WordPress Gutenberg – Sidebar get posts list based on selected category
- Toggle between block ‘edit content’ and ‘select’ not properly working in WordPress Admin
- Select another post in a post meta like a parent page is selected while editing a page
- ResizableBox component is not selectable in block editor
- How to do store, retrieve and write attributes in the registerFormatType method in Guttenberg?
- Is there a PHP function that will return the block ID generated by WordPress?
- page.php template file render a core gutenberg component programmatically
- How to disable Gutenberg editor from Multisite Admin panel?
- wp.blocks.registerBlockType not showing what I want on the frontend
- Gutenberg work with Bootstrap Shortcodes plugin
- Adapting “wide with” Gutenberg blocks for mobile
- Remove some tags from shortcodes output? Trying to fix autop
- How to use a dynamic term id for the query block
- How to translate multiple blocks within one plugin
- How to disable the Code Editor in Gutenberg?
- Enable Gutenberg Editor when editing tags
- How to position more than one item over an image in a Gutenberg WordPress block theme
- Restrict Block from having a Parent or Ancenstor Block
- How do I highlight a WordPress Menu Item for a page that is not on the Menu?
- Registering a custom block style
- How to render initial posts on page load in a Gutenberg block using the Interactivity API?
- InnerBlocks adds any block and saves, but the editor doesn’t show child blocks on reload
- Is it possible to hide a Custom Taxonomy panel for only some posts based on a certain condition?