Password Protected Pages Excerpt

<?php
function site_admin_excerpt( $excerpt ) {
    if ( post_password_required() )
    {
        $excerpt = 'This is a private page to request the password please contact the site administrator.';
    }

    return $excerpt;
}
add_filter( 'the_excerpt', 'site_admin_excerpt' );
?>

Leave a Reply

Your email address will not be published. Required fields are marked *