Make WordPress Core

Ticket #35487: 35487.2.patch

File 35487.2.patch, 1.2 KB (added by sebastian.pisula, 10 years ago)
  • wp-includes/post-template.php

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
     
    360360 * @since 4.5.0 Introduced the `$post` parameter.
    361361 *
    362362 * @param int|WP_Post $post Optional. Post ID or WP_Post object. Default is global $post.
     363 * @param bool $private Optional. Return post excerpt for private post. Default is true.
    363364 * @return string Post excerpt.
    364365 */
    365 function get_the_excerpt( $post = null ) {
     366function get_the_excerpt( $post = null, $private = true ) {
    366367        if ( is_bool( $post ) ) {
    367368                _deprecated_argument( __FUNCTION__, '2.3' );
    368369        }
     
    372373                return '';
    373374        }
    374375
    375         if ( post_password_required() ) {
     376        if ( $private && post_password_required() ) {
    376377                return __( 'There is no excerpt because this is a protected post.' );
    377378        }
    378379
     
    397398 * @return bool
    398399 */
    399400function has_excerpt( $id = 0 ) {
    400         $post = get_post( $id );
    401         return ( !empty( $post->post_excerpt ) );
     401        return (bool) get_the_excerpt($id, false);
    402402}
    403403
    404404/**