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/sub-category-counter.php +11 -0 4.5.3 → 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
@@ -17,8 +22,14 @@
17 22 $suffix = apply_filters( 'betterdocs_category_items_counts_suffix', $suffix, get_defined_vars() );
18 23 $suffix_singular = apply_filters( 'betterdocs_category_items_counts_suffix_singular', $suffix_singular, get_defined_vars() );
19 24 $subcategory_singular_text = isset( $subcategory_text ) ? $subcategory_text : __( 'Sub Category', 'betterdocs' ); // Default singular subcategory text.
20 25 $subcategory_plural_text = isset( $subcategories_text ) ? $subcategories_text : __( 'Sub Categories', 'betterdocs' ); // Default plural subcategory text.
26 +
27 +// These are not always supplied by the caller (e.g. TemplateTags::sub_category_counts()
28 +// only passes show_count + counts). Default them so PHP 8.x does not emit
29 +// "Undefined variable" warnings; the defaults preserve the existing branch outcomes.
30 +$taxonomy = isset( $taxonomy ) ? $taxonomy : '';
31 +$sub_terms_count = isset( $sub_terms_count ) ? $sub_terms_count : 0;
21 32 ?>
22 33
23 34 <div data-count="<?php echo esc_attr( $counts ); ?>" class="betterdocs-sub-category-items-counts">
24 35 <?php