has_excerpt( int|WP_Post $post )
Determines whether the post has a custom excerpt.
Description Description
For more information on this and similar theme functions, check out the Conditional Tags article in the Theme Developer Handbook.
Parameters Parameters
Return Return
(bool) True if the post has a custom excerpt, false otherwise.
Source Source
File: wp-includes/post-template.php
function has_excerpt( $post = 0 ) { $post = get_post( $post ); return ( ! empty( $post->post_excerpt ) ); }
Expand full source code Collapse full source code View on Trac
Changelog Changelog
Version | Description |
---|---|
2.3.0 | Introduced. |
User Contributed Notes User Contributed Notes
You must log in before being able to contribute a note or feedback.
When you need to hide the auto displayed excerpt and only display your post’s excerpts.
Test for presence of excerpt in a post.
Replace auto excerpt with text or code.