Fix meta queries for non-existing fields
Well, that was to be expected, really. Hope that were all...
This commit is contained in:
parent
f42c2307fe
commit
6b4b1eadb4
14
author.php
14
author.php
@ -73,13 +73,27 @@ $tabs['chapters'] = array(
|
||||
'order' => $order,
|
||||
'meta_query' => array(
|
||||
'relation' => 'AND',
|
||||
array(
|
||||
'relation' => 'OR',
|
||||
array(
|
||||
'key' => 'fictioneer_chapter_hidden',
|
||||
'value' => '0'
|
||||
),
|
||||
array(
|
||||
'key' => 'fictioneer_chapter_hidden',
|
||||
'compare' => 'NOT EXISTS'
|
||||
)
|
||||
),
|
||||
array(
|
||||
'relation' => 'OR',
|
||||
array(
|
||||
'key' => 'fictioneer_chapter_no_chapter',
|
||||
'value' => '0'
|
||||
),
|
||||
array(
|
||||
'key' => 'fictioneer_chapter_no_chapter',
|
||||
'compare' => 'NOT EXISTS'
|
||||
)
|
||||
)
|
||||
)
|
||||
),
|
||||
|
@ -443,13 +443,27 @@ if ( ! function_exists( 'fictioneer_get_author_statistics' ) ) {
|
||||
'order' => 'DESC',
|
||||
'meta_query' => array(
|
||||
'relation' => 'AND',
|
||||
array(
|
||||
'relation' => 'OR',
|
||||
array(
|
||||
'key' => 'fictioneer_chapter_hidden',
|
||||
'value' => '0'
|
||||
),
|
||||
array(
|
||||
'key' => 'fictioneer_chapter_hidden',
|
||||
'compare' => 'NOT EXISTS'
|
||||
)
|
||||
),
|
||||
array(
|
||||
'relation' => 'OR',
|
||||
array(
|
||||
'key' => 'fictioneer_chapter_no_chapter',
|
||||
'value' => '0'
|
||||
),
|
||||
array(
|
||||
'key' => 'fictioneer_chapter_no_chapter',
|
||||
'compare' => 'NOT EXISTS'
|
||||
)
|
||||
)
|
||||
),
|
||||
'update_post_term_cache' => false
|
||||
|
@ -73,8 +73,29 @@ if ( ! function_exists( 'fictioneer_build_chapters_schema' ) ) {
|
||||
'post_type' => 'fcn_chapter',
|
||||
'post_status' => 'publish',
|
||||
'meta_query' => array(
|
||||
array( 'key' => 'fictioneer_chapter_hidden', 'compare' => '=', 'value' => 0, 'type' => 'numeric' ),
|
||||
array( 'key' => 'fictioneer_chapter_no_chapter', 'compare' => '=', 'value' => 0, 'type' => 'numeric' )
|
||||
'relation' => 'AND',
|
||||
array(
|
||||
'relation' => 'OR',
|
||||
array(
|
||||
'key' => 'fictioneer_chapter_hidden',
|
||||
'value' => '0'
|
||||
),
|
||||
array(
|
||||
'key' => 'fictioneer_chapter_hidden',
|
||||
'compare' => 'NOT EXISTS'
|
||||
)
|
||||
),
|
||||
array(
|
||||
'relation' => 'OR',
|
||||
array(
|
||||
'key' => 'fictioneer_chapter_no_chapter',
|
||||
'value' => '0'
|
||||
),
|
||||
array(
|
||||
'key' => 'fictioneer_chapter_no_chapter',
|
||||
'compare' => 'NOT EXISTS'
|
||||
)
|
||||
)
|
||||
),
|
||||
'orderby' => 'modified',
|
||||
'order' => 'DESC',
|
||||
|
@ -226,6 +226,7 @@ if ( ! function_exists( 'fictioneer_query_followed_chapters' ) ) {
|
||||
'post_type' => 'fcn_chapter',
|
||||
'post_status' => 'publish',
|
||||
'meta_query' => array(
|
||||
'relation' => 'AND',
|
||||
array(
|
||||
'key' => 'fictioneer_chapter_story',
|
||||
'value' => $story_ids,
|
||||
|
@ -43,10 +43,20 @@ $query_args = array(
|
||||
'order' => $args['order'],
|
||||
'orderby' => $args['orderby'],
|
||||
'posts_per_page' => $args['count'] + 8, // Little buffer in case of unpublished parent story
|
||||
'meta_key' => 'fictioneer_chapter_hidden',
|
||||
'meta_value' => 0,
|
||||
'no_found_rows' => true,
|
||||
'update_post_term_cache' => false
|
||||
'update_post_term_cache' => false,
|
||||
'meta_query' => array(
|
||||
'relation' => 'OR',
|
||||
array(
|
||||
'key' => 'fictioneer_chapter_hidden',
|
||||
'compare' => 'NOT EXISTS'
|
||||
),
|
||||
array(
|
||||
'key' => 'fictioneer_chapter_hidden',
|
||||
'value' => 0,
|
||||
'compare' => '='
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
// Author?
|
||||
|
@ -44,10 +44,20 @@ $query_args = array(
|
||||
'orderby' => $args['orderby'],
|
||||
'order' => $args['order'],
|
||||
'posts_per_page' => $args['count'] + 8, // Little buffer in case of unpublished parent story
|
||||
'meta_key' => 'fictioneer_chapter_hidden',
|
||||
'meta_value' => 0,
|
||||
'no_found_rows' => true,
|
||||
'update_post_term_cache' => false
|
||||
'update_post_term_cache' => false,
|
||||
'meta_query' => array(
|
||||
'relation' => 'OR',
|
||||
array(
|
||||
'key' => 'fictioneer_chapter_hidden',
|
||||
'compare' => 'NOT EXISTS'
|
||||
),
|
||||
array(
|
||||
'key' => 'fictioneer_chapter_hidden',
|
||||
'value' => 0,
|
||||
'compare' => '='
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
// Author?
|
||||
|
Loading…
x
Reference in New Issue
Block a user