Account for missing parent story in global password note

This commit is contained in:
Tetrakern 2024-03-03 12:32:43 +01:00
parent 143340a4db
commit e039c39f73

View File

@ -154,7 +154,7 @@ get_header( null, $header_args );
// Password note
$password_note = fictioneer_get_content_field( 'fictioneer_chapter_password_note', $post->ID );
if ( post_password_required() && empty( $password_note ) ) {
if ( $story_post && post_password_required() && empty( $password_note ) ) {
$password_note = fictioneer_get_content_field( 'fictioneer_story_password_note', $story_id );
if ( ! empty( $password_note ) && strpos( $password_note, '[!global]' ) !== false ) {