the_excerpt filter-hookWP 0.71

Filters the displayed post excerpt.

Usage

add_filter( 'the_excerpt', 'wp_kama_the_excerpt_filter' );

/**
 * Function for `the_excerpt` filter-hook.
 * 
 * @param string $post_excerpt The post excerpt.
 *
 * @return string
 */
function wp_kama_the_excerpt_filter( $post_excerpt ){

	// filter...
	return $post_excerpt;
}
$post_excerpt(string)
The post excerpt.

Changelog

Since 0.71 Introduced.

Where the hook is called

the_excerpt()
the_excerpt
WP_REST_Revisions_Controller::prepare_excerpt_response()
the_excerpt
WP_REST_Posts_Controller::prepare_item_for_response()
the_excerpt
WP_REST_Attachments_Controller::prepare_item_for_response()
the_excerpt
do_trackbacks()
the_excerpt
wp-includes/post-template.php 394
echo apply_filters( 'the_excerpt', get_the_excerpt() );
wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php 829
$excerpt = apply_filters( 'the_excerpt', $excerpt, $post );
wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php 1825
$excerpt = apply_filters( 'the_excerpt', $excerpt );
wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php 744
$caption = apply_filters( 'the_excerpt', $caption );
wp-includes/comment.php 2914
$excerpt = apply_filters( 'the_excerpt', $post->post_excerpt );

Where the hook is used in WordPress

wp-includes/default-filters.php 193
add_filter( 'the_excerpt', 'wptexturize' );
wp-includes/default-filters.php 194
add_filter( 'the_excerpt', 'convert_smilies' );
wp-includes/default-filters.php 195
add_filter( 'the_excerpt', 'convert_chars' );
wp-includes/default-filters.php 196
add_filter( 'the_excerpt', 'wpautop' );
wp-includes/default-filters.php 197
add_filter( 'the_excerpt', 'shortcode_unautop' );
wp-includes/default-filters.php 198
add_filter( 'the_excerpt', 'wp_filter_content_tags' );
wp-includes/default-filters.php 199
add_filter( 'the_excerpt', 'wp_replace_insecure_home_url' );