Some post author cache optimizations
This commit is contained in:
parent
ec0c278653
commit
7599fa25b0
@ -55,7 +55,11 @@ if ( ! function_exists( 'fictioneer_get_card_list' ) ) {
|
||||
$query = new WP_Query( $the_query_args );
|
||||
|
||||
// Prime author cache
|
||||
if ( ! empty( $query->posts ) && function_exists( 'update_post_author_caches' ) ) {
|
||||
if (
|
||||
get_option( 'fictioneer_show_authors' ) &&
|
||||
! empty( $query->posts ) &&
|
||||
function_exists( 'update_post_author_caches' )
|
||||
) {
|
||||
update_post_author_caches( $query->posts );
|
||||
}
|
||||
}
|
||||
|
@ -20,7 +20,11 @@ if ( ! function_exists( 'fictioneer_shortcode_query' ) ) {
|
||||
$result = new WP_Query( $args );
|
||||
|
||||
// Prime author cache
|
||||
if ( ! empty( $result->posts ) && function_exists( 'update_post_author_caches' ) ) {
|
||||
if (
|
||||
get_option( 'fictioneer_show_authors' ) &&
|
||||
! empty( $result->posts ) &&
|
||||
function_exists( 'update_post_author_caches' )
|
||||
) {
|
||||
update_post_author_caches( $result->posts );
|
||||
}
|
||||
|
||||
|
@ -152,11 +152,6 @@ $disable_folding = fictioneer_get_field( 'fictioneer_story_disable_collapse' );
|
||||
)
|
||||
);
|
||||
|
||||
// Prime author cache
|
||||
if ( function_exists( 'update_post_author_caches' ) ) {
|
||||
update_post_author_caches( $chapter_query->posts );
|
||||
}
|
||||
|
||||
// Prepare chapter groups
|
||||
if ( $chapter_query->have_posts() ) {
|
||||
while( $chapter_query->have_posts() ) {
|
||||
|
@ -77,7 +77,7 @@
|
||||
$featured_query = new WP_Query( $query_args );
|
||||
|
||||
// Prime author cache
|
||||
if ( function_exists( 'update_post_author_caches' ) ) {
|
||||
if ( ! empty( $featured_query->posts ) && function_exists( 'update_post_author_caches' ) ) {
|
||||
update_post_author_caches( $featured_query->posts );
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user