Make WordPress Core


Ignore:
Timestamp:
02/05/2017 02:34:16 PM (5 years ago)
Author:
SergeyBiryukov
Message:

Docs: Clarify that has_excerpt() checks if the post has a custom excerpt, not some generated excerpt.

See #35487.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/post-template.php

    r40027 r40042  
    399399
    400400/**
    401  * Whether post has excerpt.
     401 * Whether the post has a custom excerpt.
    402402 *
    403403 * @since 2.3.0
    404404 *
    405  * @param int|WP_Post $id Optional. Post ID or post object.
    406  * @return bool
    407  */
    408 function has_excerpt( $id = 0 ) {
    409     $post = get_post( $id );
     405 * @param int|WP_Post $post Optional. Post ID or WP_Post object. Default is global $post.
     406 * @return bool True if the post has a custom excerpt, false otherwise.
     407 */
     408function has_excerpt( $post = 0 ) {
     409    $post = get_post( $post );
    410410    return ( !empty( $post->post_excerpt ) );
    411411}
Note: See TracChangeset for help on using the changeset viewer.