PluginProbe
BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot / 4.9.3
BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot v4.9.3
4.9.3 4.9.2 4.9.1 4.9.0 4.8.2 4.8.1 4.8.0 4.7.0 4.6.2 4.6.1 4.6.0 4.5.6 4.5.5 4.5.4 4.5.3 4.5.2 4.5.1 4.5.0 4.4.1 4.4.0 3.3.4 3.4.0 3.4.1 3.4.2 3.5.0 All 201 releases
← All changes | views/template-parts/category-counter.php +11 -10 4.4.0 → 4.9.3 View file →
@@ -1,5 +1,10 @@
1 1 <?php
2 +// phpcs:disable WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- view template receives variables via extract(); prefixing is impractical.
3 +
4 +if ( ! defined( 'ABSPATH' ) ) {
5 + exit;
6 +}
2 7 if ( ! $show_count ) {
3 8 return;
4 9 }
5 10
@@ -20,22 +25,18 @@
20 25
21 26 <div data-count="<?php echo esc_attr( $counts ); ?>" class="betterdocs-category-items-counts">
22 27 <span>
23 28 <?php
29 + // Layout-only format string — not wrapped in _n() because it contains
30 + // nothing but positional placeholders, and translator typos in the
31 + // placeholder numbers (e.g. %4$s instead of %3$s) crash sprintf() on
32 + // PHP 8.x with ArgumentCountError.
24 33 echo esc_html(
25 34 sprintf(
26 - /* translators: %s: Number of items. */
27 - // phpcs:ignore WordPress.WP.I18n.MissingTranslatorsComment, WordPress.WP.I18n.MismatchedPlaceholders
28 - _n(
29 - '%1$s %2$s %3$s',
30 - '%1$s %2$s %4$s',
31 - $counts,
32 - 'betterdocs'
33 - ),
35 + '%1$s %2$s %3$s',
34 36 esc_html( $prefix ),
35 37 esc_html( $counts ),
36 - esc_html( $suffix_singular ),
37 - esc_html( $suffix )
38 + esc_html( $counts === 1 ? $suffix_singular : $suffix )
38 39 )
39 40 );
40 41 ?>
41 42 </span>