Update word count node conditions on cards

This commit is contained in:
Tetrakern 2024-06-04 11:57:30 +02:00
parent 70fb1a4706
commit 4466e2aa18
3 changed files with 6 additions and 4 deletions

View File

@ -218,8 +218,10 @@ $thumbnail_args = array(
esc_attr__( 'Chapters', 'fictioneer' ) . '"></i> ' . $story['chapter_count'];
}
$footer_items['words'] = '<i class="card-footer-icon fa-solid fa-font" title="' .
esc_attr__( 'Total Words', 'fictioneer' ) . '"></i> ' . $story['word_count_short'];
if ( $story['word_count'] > 2000 || $story['status'] === 'Oneshot' ) {
$footer_items['words'] = '<i class="card-footer-icon fa-solid fa-font" title="' .
esc_attr__( 'Total Words', 'fictioneer' ) . '"></i> ' . $story['word_count_short'];
}
if ( ( $args['orderby'] ?? 0 ) === 'date' ) {
$footer_items['publish_date'] = '<i class="card-footer-icon fa-solid fa-clock" title="' .

View File

@ -280,7 +280,7 @@ remove_filter( 'posts_where', 'fictioneer_exclude_protected_posts' );
esc_attr__( 'Chapters', 'fictioneer' ) . '"></i> ' . $story['chapter_count'];
}
if ( $story['word_count'] > 0 ) {
if ( $story['word_count'] > 2000 || $story['status'] === 'Oneshot' ) {
$footer_items['words'] = '<i class="card-footer-icon fa-solid fa-font" title="' .
esc_attr__( 'Total Words', 'fictioneer' ) . '"></i> ' . $story['word_count_short'];
}

View File

@ -266,7 +266,7 @@ remove_filter( 'posts_where', 'fictioneer_exclude_protected_posts' );
esc_attr__( 'Chapters', 'fictioneer' ) . '"></i> ' . $story['chapter_count'];
}
if ( $story['word_count'] > 0 ) {
if ( $story['word_count'] > 2000 || $story['status'] === 'Oneshot' ) {
$footer_items['words'] = '<i class="card-footer-icon fa-solid fa-font" title="' .
esc_attr__( 'Total Words', 'fictioneer' ) . '"></i> ' . $story['word_count_short'];
}