A WordPress-centric search engine for devs and theme authors



has_excerpt ›

Since2.3.0
Deprecatedn/a
has_excerpt ( $post = 0 )
Parameters:
  • (int|WP_Post) $post Optional. Post ID or WP_Post object. Default is global $post.
    Required: No
    Default:
Returns:
  • (bool) True if the post has a custom excerpt, false otherwise.
Defined at:
Codex:

Determines whether the post has a custom excerpt.

For more information on this and similar theme functions, check out the {@link https://developer.wordpress.org/themes/basics/conditional-tags/ Conditional Tags} article in the Theme Developer Handbook.



Source

function has_excerpt( $post = 0 ) {
	$post = get_post( $post );
	return ( ! empty( $post->post_excerpt ) );
}