the_content
Filters the post content.
Usage
add_filter( 'the_content', 'wp_kama_the_content_filter' );
/**
* Function for `the_content` filter-hook.
*
* @param string $content Content of the current post.
*
* @return string
*/
function wp_kama_the_content_filter( $content ){
// filter...
return $content;
}
- $content(string)
- Content of the current post.
Changelog
| Since 0.71 | Introduced. |
Where the hook is called
the_content
the_content
the_content
the_content
the_content
wp-includes/post-template.php 256
$content = apply_filters( 'the_content', $content );
wp-includes/blocks.php 1506-1509
$response->data['content']['rendered'] = apply_filters( 'the_content', $response->data['content']['raw'] );
wp-includes/blocks/post-content.php 50
$content = apply_filters( 'the_content', str_replace( ']]>', ']]>', $content ) );
wp-includes/feed.php 196
$content = apply_filters( 'the_content', get_the_content() );
wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php 683
$data['content']['rendered'] = apply_filters( 'the_content', $post->post_content );
wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php 2007
$data['content']['rendered'] = post_password_required( $post ) ? '' : apply_filters( 'the_content', $post->post_content );
wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php 920
'rendered' => apply_filters( 'the_content', $post->post_content ),
wp-includes/formatting.php 3983
$text = apply_filters( 'the_content', $text );
wp-includes/comment.php 3113
$excerpt = apply_filters( 'the_content', $post->post_content, $post->ID );
Where the hook is used in WordPress
wp-includes/blocks.php 1502
remove_filter( 'the_content', 'apply_block_hooks_to_content_from_post_object', $priority );
wp-includes/blocks.php 1513
add_filter( 'the_content', 'apply_block_hooks_to_content_from_post_object', $priority );
wp-includes/blocks.php 2528
remove_filter( 'the_content', 'wpautop', $priority );
wp-includes/blocks.php 2529
add_filter( 'the_content', '_restore_wpautop_hook', $priority + 1 );
wp-includes/blocks.php 2548
add_filter( 'the_content', 'wpautop', $current_priority - 1 );
wp-includes/blocks.php 2549
remove_filter( 'the_content', '_restore_wpautop_hook', $current_priority );
wp-includes/class-wp-embed.php 33
add_filter( 'the_content', array( $this, 'run_shortcode' ), 8 );
wp-includes/class-wp-embed.php 41
add_filter( 'the_content', array( $this, 'autoembed' ), 8 );
wp-includes/default-filters.php 171
add_filter( $filter, 'capital_P_dangit', 11 );
wp-includes/default-filters.php 201
add_filter( 'the_content', 'apply_block_hooks_to_content_from_post_object', 8 ); // BEFORE do_blocks().
wp-includes/default-filters.php 202
add_filter( 'the_content', 'do_blocks', 9 );
wp-includes/default-filters.php 203
add_filter( 'the_content', 'wptexturize' );
wp-includes/default-filters.php 204
add_filter( 'the_content', 'convert_smilies', 20 );
wp-includes/default-filters.php 205
add_filter( 'the_content', 'wpautop' );
wp-includes/default-filters.php 206
add_filter( 'the_content', 'shortcode_unautop' );
wp-includes/default-filters.php 207
add_filter( 'the_content', 'prepend_attachment' );
wp-includes/default-filters.php 208
add_filter( 'the_content', 'wp_replace_insecure_home_url' );
wp-includes/default-filters.php 209
add_filter( 'the_content', 'do_shortcode', 11 ); // AFTER wpautop().
wp-includes/default-filters.php 210
add_filter( 'the_content', 'wp_filter_content_tags', 12 ); // Runs after do_shortcode().
wp-includes/formatting.php 3974
$filter_image_removed = remove_filter( 'the_content', 'wp_filter_content_tags', 12 );
wp-includes/formatting.php 3980
$filter_block_removed = remove_filter( 'the_content', 'do_blocks', 9 );
wp-includes/formatting.php 3988
add_filter( 'the_content', 'do_blocks', 9 );
wp-includes/formatting.php 3997
add_filter( 'the_content', 'wp_filter_content_tags', 12 );
wp-includes/template-loader.php 96
remove_filter( 'the_content', 'prepend_attachment' );