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/nested-categories.php +9 -1 4.9.1 → 4.9.3 View file →
@@ -234,7 +234,15 @@
234 234 $bd_nested_depth--;
235 235
236 236 if ( $bd_is_outermost ) {
237 237 $bd_html = ob_get_clean();
238 - set_transient( $bd_cache_key, $bd_html, HOUR_IN_SECONDS * 6 );
238 + // Never cache an empty render. An empty buffer means every child term was
239 + // skipped ( $_counts <= 0 ), which is usually a transient data state — stale
240 + // counts mid-import, docs not yet published. The read guard treats '' as a hit
241 + // ( '' !== false ), so caching it would pin a blank nested block for 6 hours
242 + // after the data is already correct. Re-rendering once per request while empty
243 + // is what lets it self-heal. (#165)
244 + if ( '' !== $bd_html ) {
245 + set_transient( $bd_cache_key, $bd_html, HOUR_IN_SECONDS * 6 );
246 + }
239 247 echo $bd_html; //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
240 248 }