default_excerpt
Filters the default post excerpt initially used in the "Write Post" form.
Usage
add_filter( 'default_excerpt', 'wp_kama_default_excerpt_filter', 10, 2 ); /** * Function for `default_excerpt` filter-hook. * * @param string $post_excerpt Default post excerpt. * @param WP_Post $post Post object. * * @return string */ function wp_kama_default_excerpt_filter( $post_excerpt, $post ){ // filter... return $post_excerpt; }
- $post_excerpt(string)
- Default post excerpt.
- $post(WP_Post)
- Post object.
Changelog
Since 1.5.0 | Introduced. |
Where the hook is called
wp-admin/includes/post.php 828
$post->post_excerpt = (string) apply_filters( 'default_excerpt', $post_excerpt, $post );