From d20d535e2411e08a9357bcf3f28ce1c3e26d7256 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sun, 5 Feb 2017 14:34:16 +0000 Subject: [PATCH] Docs: Clarify that `has_excerpt()` checks if the post has a custom excerpt, not some generated excerpt. See #35487. git-svn-id: https://develop.svn.wordpress.org/trunk@40042 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/post-template.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/wp-includes/post-template.php b/src/wp-includes/post-template.php index c058ed7a48..924e3996fb 100644 --- a/src/wp-includes/post-template.php +++ b/src/wp-includes/post-template.php @@ -398,15 +398,15 @@ function get_the_excerpt( $post = null ) { } /** - * Whether post has excerpt. + * Whether the post has a custom excerpt. * * @since 2.3.0 * - * @param int|WP_Post $id Optional. Post ID or post object. - * @return bool + * @param int|WP_Post $post Optional. Post ID or WP_Post object. Default is global $post. + * @return bool True if the post has a custom excerpt, false otherwise. */ -function has_excerpt( $id = 0 ) { - $post = get_post( $id ); +function has_excerpt( $post = 0 ) { + $post = get_post( $post ); return ( !empty( $post->post_excerpt ) ); }