WordPress at a glance

has_excerpt() WP 1.0

Whether the post has a custom excerpt.

No Hooks.

Return

true/false. True if the post has a custom excerpt, false otherwise.

Usage

has_excerpt( $post );
$post(int/WP_Post)
Post ID or WP_Post object.
Default: global $post

Code of has_excerpt: wp-includes/post-template.php VER 4.9.8

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

Related Functions

From tag: excerpt (fragment, snippet)

More from tag: Conditional tags (all)

More from category: Posts, pages...

No comments
    Hello, !     Log In . Register