Made chapter meta queries more resilient

This commit is contained in:
Tetrakern 2023-06-16 02:03:31 +02:00
parent b34bb3b8ef
commit 97fb5cae04
2 changed files with 20 additions and 5 deletions

View File

@ -34,8 +34,17 @@ $query_args = array (
'order' => $order,
'paged' => $page,
'posts_per_page' => get_option( 'posts_per_page', 8 ),
'meta_key' => 'fictioneer_chapter_hidden',
'meta_value' => '0'
'meta_query' => array(
'relation' => 'OR',
array(
'key' => 'fictioneer_chapter_hidden',
'value' => '0'
),
array(
'key' => 'fictioneer_chapter_hidden',
'compare' => 'NOT EXISTS'
)
)
);
// Append date query (if any)

View File

@ -265,10 +265,16 @@ if ( ! function_exists( 'fictioneer_query_followed_chapters' ) ) {
'value' => $story_ids,
'compare' => 'IN',
),
array(
'relation' => 'OR',
array(
'key' => 'fictioneer_chapter_hidden',
'value' => 0,
'compare' => '=',
'value' => '0'
),
array(
'key' => 'fictioneer_chapter_hidden',
'compare' => 'NOT EXISTS'
)
)
),
'numberposts' => $count,