check if post is password protected
This commit is contained in:
parent
62ef84aff7
commit
2274bd0074
1 changed files with 2 additions and 2 deletions
|
@ -82,7 +82,7 @@ class Shortcodes {
|
||||||
public static function excerpt( $atts, $content, $tag ) {
|
public static function excerpt( $atts, $content, $tag ) {
|
||||||
$post = get_post();
|
$post = get_post();
|
||||||
|
|
||||||
if ( ! $post ) {
|
if ( ! $post || \post_password_required( $post ) ) {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -185,7 +185,7 @@ class Shortcodes {
|
||||||
public static function content( $atts, $content, $tag ) {
|
public static function content( $atts, $content, $tag ) {
|
||||||
$post = get_post();
|
$post = get_post();
|
||||||
|
|
||||||
if ( ! $post ) {
|
if ( ! $post || \post_password_required( $post ) ) {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue