diff --git a/partials/_article-cards.php b/partials/_article-cards.php index 6755f365..ad90c541 100644 --- a/partials/_article-cards.php +++ b/partials/_article-cards.php @@ -51,7 +51,7 @@ $show_terms = ! in_array( $args['terms'], ['none', 'false'] ); $query_args = array( 'fictioneer_query_name' => 'article_cards', 'post_type' => $args['post_type'], - 'post_status' => $args['post_status'] ?? 'publish', + 'post_status' => $args['post_status'], 'post__in' => $args['post_ids'], // May be empty! 'order' => $args['order'], 'orderby' => $args['orderby'], @@ -176,6 +176,8 @@ if ( $splide ) { } // Extra classes + $card_classes[] = '_' . $args['post_status']; + if ( get_theme_mod( 'card_style', 'default' ) !== 'default' ) { $card_classes[] = '_' . get_theme_mod( 'card_style' ); } diff --git a/partials/_latest-chapters-compact.php b/partials/_latest-chapters-compact.php index a0795000..b3b80240 100644 --- a/partials/_latest-chapters-compact.php +++ b/partials/_latest-chapters-compact.php @@ -52,7 +52,7 @@ $card_counter = 0; $query_args = array( 'fictioneer_query_name' => 'latest_chapters_compact', 'post_type' => 'fcn_chapter', - 'post_status' => $args['post_status'] ?? 'publish', + 'post_status' => $args['post_status'], 'post__in' => $args['post_ids'], // May be empty! 'order' => $args['order'], 'orderby' => $args['orderby'], @@ -169,6 +169,8 @@ if ( $splide ) { $card_classes = []; // Extra card classes + $card_classes[] = '_' . $args['post_status']; + if ( ! empty( $post->post_password ) ) { $card_classes[] = '_password'; } diff --git a/partials/_latest-chapters-list.php b/partials/_latest-chapters-list.php index 1d029d52..bdcf64fd 100644 --- a/partials/_latest-chapters-list.php +++ b/partials/_latest-chapters-list.php @@ -57,7 +57,7 @@ $content_list_style = get_theme_mod( 'content_list_style', 'default' ); $query_args = array( 'fictioneer_query_name' => 'latest_chapters_list', 'post_type' => 'fcn_chapter', - 'post_status' => $args['post_status'] ?? 'publish', + 'post_status' => $args['post_status'], 'post__in' => $args['post_ids'], // May be empty! 'orderby' => $args['orderby'], 'order' => $args['order'], @@ -201,7 +201,7 @@ if ( $splide ) { } // Extra classes - $classes = []; + $classes = [ '_' . $args['post_status'] ]; if ( ! empty( $post->post_password ) ) { $classes[] = '_password'; diff --git a/partials/_latest-chapters.php b/partials/_latest-chapters.php index 93f99226..04ef14b3 100644 --- a/partials/_latest-chapters.php +++ b/partials/_latest-chapters.php @@ -57,7 +57,7 @@ $card_counter = 0; $query_args = array( 'fictioneer_query_name' => 'latest_chapters', 'post_type' => 'fcn_chapter', - 'post_status' => $args['post_status'] ?? 'publish', + 'post_status' => $args['post_status'], 'post__in' => $args['post_ids'], // May be empty! 'orderby' => $args['orderby'], 'order' => $args['order'], @@ -178,6 +178,8 @@ if ( $splide ) { } // Extra card classes + $card_classes[] = '_' . $args['post_status']; + if ( ! empty( $post->post_password ) ) { $card_classes[] = '_password'; } diff --git a/partials/_latest-posts.php b/partials/_latest-posts.php index fd9dfcee..c3564f77 100644 --- a/partials/_latest-posts.php +++ b/partials/_latest-posts.php @@ -33,7 +33,7 @@ defined( 'ABSPATH' ) OR exit; $query_args = array( 'fictioneer_query_name' => 'latest_posts', 'post_type' => 'post', - 'post_status' => $args['post_status'] ?? 'publish', + 'post_status' => $args['post_status'], 'post__in' => $args['post_ids'], // May be empty! 'order' => 'DESC', 'orderby' => 'date', @@ -89,6 +89,9 @@ $query_args = apply_filters( 'fictioneer_filter_shortcode_latest_posts_query_arg // Query post $latest_entries = fictioneer_shortcode_query( $query_args ); +// Classes +$args['classes'] .= ' _' . $args['post_status']; + ?>
diff --git a/partials/_latest-recommendations-compact.php b/partials/_latest-recommendations-compact.php index de507b8f..ba28e521 100644 --- a/partials/_latest-recommendations-compact.php +++ b/partials/_latest-recommendations-compact.php @@ -49,7 +49,7 @@ $show_terms = ! in_array( $args['terms'], ['none', 'false'] ) && $query_args = array ( 'fictioneer_query_name' => 'latest_recommendations_compact', 'post_type' => 'fcn_recommendation', - 'post_status' => $args['post_status'] ?? 'publish', + 'post_status' => $args['post_status'], 'post__in' => $args['post_ids'], // May be empty! 'order' => $args['order'], 'orderby' => $args['orderby'], @@ -144,7 +144,9 @@ if ( $splide ) { $grid_or_vertical = $args['vertical'] ? '_vertical' : '_grid'; $card_classes = []; - // Extra classes + // Extra card classes + $card_classes[] = '_' . $args['post_status']; + if ( $show_terms ) { $card_classes[] = '_info'; } diff --git a/partials/_latest-recommendations.php b/partials/_latest-recommendations.php index 44ceab59..0a361fae 100644 --- a/partials/_latest-recommendations.php +++ b/partials/_latest-recommendations.php @@ -47,7 +47,7 @@ $show_terms = ! get_option( 'fictioneer_hide_taxonomies_on_recommendation_cards' $query_args = array ( 'fictioneer_query_name' => 'latest_recommendations', 'post_type' => 'fcn_recommendation', - 'post_status' => $args['post_status'] ?? 'publish', + 'post_status' => $args['post_status'], 'post__in' => $args['post_ids'], // May be empty! 'order' => $args['order'], 'orderby' => $args['orderby'], @@ -141,7 +141,9 @@ if ( $splide ) { $grid_or_vertical = $args['vertical'] ? '_vertical' : '_grid'; $card_classes = []; - // Extra classes + // Extra card classes + $card_classes[] = '_' . $args['post_status']; + if ( get_theme_mod( 'card_style', 'default' ) !== 'default' ) { $card_classes[] = '_' . get_theme_mod( 'card_style' ); } diff --git a/partials/_latest-stories-compact.php b/partials/_latest-stories-compact.php index 2e5e2bcb..bdb53fd5 100644 --- a/partials/_latest-stories-compact.php +++ b/partials/_latest-stories-compact.php @@ -57,7 +57,7 @@ $show_terms = ! in_array( $args['terms'], ['none', 'false'] ) && $query_args = array( 'fictioneer_query_name' => 'latest_stories_compact', 'post_type' => 'fcn_story', - 'post_status' => $args['post_status'] ?? 'publish', + 'post_status' => $args['post_status'], 'post__in' => $args['post_ids'], // May be empty! 'order' => $args['order'], 'orderby' => $args['orderby'], @@ -172,7 +172,9 @@ if ( $splide ) { ); $short_description = mb_strlen( $short_description, 'UTF-8' ) < 30 ? get_the_excerpt() : $short_description; - // Extra classes + // Extra card classes + $card_classes[] = '_' . $args['post_status']; + if ( $show_terms ) { $card_classes[] = '_info'; } diff --git a/partials/_latest-stories-list.php b/partials/_latest-stories-list.php index 55e03576..3dfa8e53 100644 --- a/partials/_latest-stories-list.php +++ b/partials/_latest-stories-list.php @@ -58,7 +58,7 @@ $content_list_style = get_theme_mod( 'content_list_style', 'default' ); $query_args = array( 'fictioneer_query_name' => 'latest_stories_list', 'post_type' => 'fcn_story', - 'post_status' => $args['post_status'] ?? 'publish', + 'post_status' => $args['post_status'], 'post__in' => $args['post_ids'], // May be empty! 'order' => $args['order'], 'orderby' => $args['orderby'], @@ -185,7 +185,7 @@ if ( $splide ) { } // Extra classes - $classes = []; + $classes = [ '_' . $args['post_status'] ]; if ( $is_sticky ) { $classes[] = '_sticky'; diff --git a/partials/_latest-stories.php b/partials/_latest-stories.php index e940fcde..ab108d3c 100644 --- a/partials/_latest-stories.php +++ b/partials/_latest-stories.php @@ -58,7 +58,7 @@ $show_terms = ! in_array( $args['terms'], ['none', 'false'] ) && $query_args = array( 'fictioneer_query_name' => 'latest_stories', 'post_type' => 'fcn_story', - 'post_status' => $args['post_status'] ?? 'publish', + 'post_status' => $args['post_status'], 'post__in' => $args['post_ids'], // May be empty! 'order' => $args['order'], 'orderby' => $args['orderby'], @@ -168,6 +168,9 @@ if ( $splide ) { $grid_or_vertical = $args['vertical'] ? '_vertical' : '_grid'; $card_classes = []; + // Extra card classes + $card_classes[] = '_' . $args['post_status']; + if ( $is_sticky ) { $card_classes[] = '_sticky'; } diff --git a/partials/_latest-updates-compact.php b/partials/_latest-updates-compact.php index 8ef8cb8d..351b3fce 100644 --- a/partials/_latest-updates-compact.php +++ b/partials/_latest-updates-compact.php @@ -60,7 +60,7 @@ $card_counter = 0; $query_args = array( 'fictioneer_query_name' => 'latest_updates_compact', 'post_type' => 'fcn_story', - 'post_status' => $args['post_status'] ?? 'publish', + 'post_status' => $args['post_status'], 'post__in' => $args['post_ids'], // May be empty! 'order' => $args['order'], 'orderby' => 'meta_value', @@ -182,7 +182,9 @@ if ( $splide ) { continue; } - // Extra classes + // Extra card classes + $card_classes[] = '_' . $args['post_status']; + if ( ! empty( $post->post_password ) ) { $card_classes[] = '_password'; } diff --git a/partials/_latest-updates-list.php b/partials/_latest-updates-list.php index ec2f326d..54de9c39 100644 --- a/partials/_latest-updates-list.php +++ b/partials/_latest-updates-list.php @@ -63,7 +63,7 @@ $content_list_style = get_theme_mod( 'content_list_style', 'default' ); $query_args = array( 'fictioneer_query_name' => 'latest_updates_list', 'post_type' => 'fcn_story', - 'post_status' => $args['post_status'] ?? 'publish', + 'post_status' => $args['post_status'], 'post__in' => $args['post_ids'], // May be empty! 'order' => $args['order'], 'orderby' => 'meta_value', @@ -206,7 +206,7 @@ if ( $splide ) { } // Extra classes - $classes = []; + $classes = [ '_' . $args['post_status'] ]; if ( ! empty( $post->post_password ) ) { $classes[] = '_password'; diff --git a/partials/_latest-updates.php b/partials/_latest-updates.php index b22b9122..9c98181b 100644 --- a/partials/_latest-updates.php +++ b/partials/_latest-updates.php @@ -66,7 +66,7 @@ $show_terms = ! get_option( 'fictioneer_hide_taxonomies_on_story_cards' ) && $query_args = array( 'fictioneer_query_name' => 'latest_updates', 'post_type' => 'fcn_story', - 'post_status' => $args['post_status'] ?? 'publish', + 'post_status' => $args['post_status'], 'post__in' => $args['post_ids'], // May be empty! 'order' => $args['order'], 'orderby' => 'meta_value', @@ -187,7 +187,9 @@ if ( $splide ) { continue; } - // Extra classes + // Extra card classes + $card_classes[] = '_' . $args['post_status']; + if ( ! empty( $post->post_password ) ) { $card_classes[] = '_password'; } diff --git a/partials/_showcase.php b/partials/_showcase.php index dee3a4b4..2304c8ad 100644 --- a/partials/_showcase.php +++ b/partials/_showcase.php @@ -47,7 +47,7 @@ $splide = $args['splide'] ?? 0; $query_args = array ( 'fictioneer_query_name' => 'showcase', 'post_type' => $args['post_type'], - 'post_status' => $args['post_status'] ?? 'publish', + 'post_status' => $args['post_status'], 'post__in' => $args['post_ids'], // May be empty! 'order' => $args['order'], 'orderby' => $args['orderby'], @@ -130,7 +130,7 @@ if ( $args['min_width'] ) { } // Classes - $classes = ''; + $classes = '_' . $args['post_status']; if ( $args['aspect_ratio'] ) { $classes .= ' _aspect-ratio';