_wp_apply_block_content_filters( string $content, string $context = '', array|null $seen_ids = null, string|null $id = null ): string

This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only by core. It is listed here for completeness.

Applies standard content filters similar to the ‘the_content’ filter.

Description

This function runs the typical content processing filters that WordPress applies to post content, useful for blocks that render nested content.

Parameters

$contentstringrequired
The content to process.
$contextstringoptional
Context identifier for wp_filter_content_tags() .
More Arguments from wp_filter_content_tags( … $context )Additional context to pass to the filters.
Defaults to current_filter() when not set.

Default:''

$seen_idsarray|nulloptional
Reference to an array tracking seen IDs for recursion prevention.

Default:null

$idstring|nulloptional
Unique identifier for this content, used with $seen_ids.

Default:null

Return

string The processed content.

Source

function _wp_apply_block_content_filters( $content, $context = '', &$seen_ids = null, $id = null ) {
	$content = shortcode_unautop( $content );
	$content = do_shortcode( $content );

	if ( null !== $seen_ids && null !== $id ) {
		$seen_ids[ $id ] = true;
	}

	try {
		$content = do_blocks( $content );
	} finally {
		if ( null !== $seen_ids && null !== $id ) {
			unset( $seen_ids[ $id ] );
		}
	}

	$content = wptexturize( $content );
	$content = convert_smilies( $content );
	$content = wp_filter_content_tags( $content, $context );

	global $wp_embed;
	$content = $wp_embed->autoembed( $content );

	return $content;
}

Changelog

VersionDescription
7.1.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.