Skip to content

Commit 2274bd0

Browse files
committed
check if post is password protected
1 parent 62ef84a commit 2274bd0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

includes/class-shortcodes.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public static function title( $atts, $content, $tag ) {
8282
public static function excerpt( $atts, $content, $tag ) {
8383
$post = get_post();
8484

85-
if ( ! $post ) {
85+
if ( ! $post || \post_password_required( $post ) ) {
8686
return '';
8787
}
8888

@@ -185,7 +185,7 @@ public static function excerpt( $atts, $content, $tag ) {
185185
public static function content( $atts, $content, $tag ) {
186186
$post = get_post();
187187

188-
if ( ! $post ) {
188+
if ( ! $post || \post_password_required( $post ) ) {
189189
return '';
190190
}
191191

0 commit comments

Comments
 (0)