Chapter card rating defaults to story

This commit is contained in:
Tetrakern 2024-09-21 00:49:54 +02:00
parent 2cb8c114c5
commit 4d059dabda
3 changed files with 12 additions and 0 deletions

View File

@ -30,6 +30,10 @@ $text_icon = get_post_meta( $post_id, 'fictioneer_chapter_text_icon', true );
$excerpt = fictioneer_get_forced_excerpt( $post, 512, true );
$card_classes = [];
if ( ! $chapter_rating && $story_id ) {
$chapter_rating = get_post_meta( $story_id, 'fictioneer_story_rating', true );
}
// Taxonomies
$tags = false;
$fandoms = false;

View File

@ -174,6 +174,10 @@ if ( $splide ) {
$chapter_rating = get_post_meta( $post_id, 'fictioneer_chapter_rating', true );
$words = fictioneer_get_word_count( $post_id );
if ( ! $chapter_rating && $story_id ) {
$chapter_rating = get_post_meta( $story_id, 'fictioneer_story_rating', true );
}
// Thumbnail
$thumbnail = null;

View File

@ -169,6 +169,10 @@ if ( $splide ) {
$grid_or_vertical = $args['vertical'] ? '_vertical' : '_grid';
$card_classes = [];
if ( ! $chapter_rating && $story_id ) {
$chapter_rating = get_post_meta( $story_id, 'fictioneer_story_rating', true );
}
// Extra card classes
if ( ! empty( $post->post_password ) ) {
$card_classes[] = '_password';