Skip to content

Commit

Permalink
Block theme: Ensure filtered query total label only applies on archiv…
Browse files Browse the repository at this point in the history
…e pages
  • Loading branch information
ryelle committed Apr 17, 2024
1 parent 082b3e8 commit 919f358
Showing 1 changed file with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,14 @@ function update_query_total_label( $label, $found_posts ) {
}

$current = strtolower( $wp_query->get( 'curation' ) );
if ( 'core' === $current ) {
/* translators: %s: the result count. */
return _n( '%s curated pattern', '%s curated patterns', $found_posts, 'wporg-patterns' );
} else if ( 'community' === $current ) {
/* translators: %s: the result count. */
return _n( '%s community pattern', '%s community patterns', $found_posts, 'wporg-patterns' );
if ( $wp_query->is_archive() ) {
if ( 'core' === $current ) {
/* translators: %s: the result count. */
return _n( '%s curated pattern', '%s curated patterns', $found_posts, 'wporg-patterns' );
} else if ( 'community' === $current ) {
/* translators: %s: the result count. */
return _n( '%s community pattern', '%s community patterns', $found_posts, 'wporg-patterns' );
}
}

/* translators: %s: the result count. */
Expand Down

0 comments on commit 919f358

Please sign in to comment.