check if post is password protected

This commit is contained in:
Matthias Pfefferle 2023-02-27 08:15:02 +01:00
parent 62ef84aff7
commit 2274bd0074

View file

@ -82,7 +82,7 @@ class Shortcodes {
public static function excerpt( $atts, $content, $tag ) {
$post = get_post();
if ( ! $post ) {
if ( ! $post || \post_password_required( $post ) ) {
return '';
}
@ -185,7 +185,7 @@ class Shortcodes {
public static function content( $atts, $content, $tag ) {
$post = get_post();
if ( ! $post ) {
if ( ! $post || \post_password_required( $post ) ) {
return '';
}