Account for deleted chapter posts in shortcodes

This commit is contained in:
Tetrakern 2024-09-26 18:12:01 +02:00
parent 66aa6f2763
commit f57db0676c
3 changed files with 12 additions and 0 deletions

View File

@ -212,6 +212,10 @@ if ( $splide ) {
foreach ( $search_list as $chapter_id ) { foreach ( $search_list as $chapter_id ) {
$chapter_post = get_post( $chapter_id ); $chapter_post = get_post( $chapter_id );
if ( ! $chapter_post ) {
continue;
}
if ( get_post_meta( $chapter_id, 'fictioneer_chapter_hidden', true ) ) { if ( get_post_meta( $chapter_id, 'fictioneer_chapter_hidden', true ) ) {
continue; continue;
} }

View File

@ -254,6 +254,10 @@ if ( $splide ) {
foreach ( $search_list as $chapter_id ) { foreach ( $search_list as $chapter_id ) {
$chapter_post = get_post( $chapter_id ); $chapter_post = get_post( $chapter_id );
if ( ! $chapter_post ) {
continue;
}
if ( ! $chapter_post || get_post_meta( $chapter_id, 'fictioneer_chapter_hidden', true ) ) { if ( ! $chapter_post || get_post_meta( $chapter_id, 'fictioneer_chapter_hidden', true ) ) {
continue; continue;
} }

View File

@ -245,6 +245,10 @@ if ( $splide ) {
foreach ( $search_list as $chapter_id ) { foreach ( $search_list as $chapter_id ) {
$chapter_post = get_post( $chapter_id ); $chapter_post = get_post( $chapter_id );
if ( ! $chapter_post ) {
continue;
}
if ( get_post_meta( $chapter_id, 'fictioneer_chapter_hidden', true ) ) { if ( get_post_meta( $chapter_id, 'fictioneer_chapter_hidden', true ) ) {
continue; continue;
} }