@@ -2567,6 +2567,52 @@ function _restore_wpautop_hook( $content ) {
25672567 return $ content ;
25682568}
25692569
2570+ /**
2571+ * Applies standard content filters similar to the 'the_content' filter.
2572+ *
2573+ * This function runs the typical content processing filters that WordPress
2574+ * applies to post content, useful for blocks that render nested content.
2575+ *
2576+ * @since 7.1.0
2577+ * @access private
2578+ *
2579+ * @global WP_Embed $wp_embed WordPress Embed object.
2580+ *
2581+ * @param string $content The content to process.
2582+ * @param string $context Optional. Context identifier for wp_filter_content_tags().
2583+ * Default empty string.
2584+ * @param array|null $seen_ids Optional. Reference to an array tracking seen IDs for
2585+ * recursion prevention. Default null.
2586+ * @param string|null $id Optional. Unique identifier for this content, used with
2587+ * $seen_ids. Default null.
2588+ * @return string The processed content.
2589+ */
2590+ function _wp_apply_block_content_filters ( $ content , $ context = '' , &$ seen_ids = null , $ id = null ) {
2591+ $ content = shortcode_unautop ( $ content );
2592+ $ content = do_shortcode ( $ content );
2593+
2594+ if ( null !== $ seen_ids && null !== $ id ) {
2595+ $ seen_ids [ $ id ] = true ;
2596+ }
2597+
2598+ try {
2599+ $ content = do_blocks ( $ content );
2600+ } finally {
2601+ if ( null !== $ seen_ids && null !== $ id ) {
2602+ unset( $ seen_ids [ $ id ] );
2603+ }
2604+ }
2605+
2606+ $ content = wptexturize ( $ content );
2607+ $ content = convert_smilies ( $ content );
2608+ $ content = wp_filter_content_tags ( $ content , $ context );
2609+
2610+ global $ wp_embed ;
2611+ $ content = $ wp_embed ->autoembed ( $ content );
2612+
2613+ return $ content ;
2614+ }
2615+
25702616/**
25712617 * Returns the current version of the block format that the content string is using.
25722618 *
0 commit comments