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 tocurrent_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
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
| Version | Description |
|---|---|
| 7.1.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.