PluginProbe
BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot / 4.9.4
BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot v4.9.4
4.9.4 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 All 202 releases
← All changes | views/layouts/base.php +9 -1 4.7.0 → 4.9.4 View file →
@@ -43,9 +43,11 @@
43 43 $ancestors = [];
44 44
45 45 if ( is_single() && ! empty( $_current_queried_object_id ) ) {
46 46 $_category_ids = wp_get_post_terms( get_the_ID(), 'doc_category', [ 'fields' => 'ids' ] );
47 - $ancestors = get_ancestors( $_category_ids[0], 'doc_category' );
47 + if ( ! is_wp_error( $_category_ids ) && ! empty( $_category_ids ) ) {
48 + $ancestors = get_ancestors( $_category_ids[0], 'doc_category' );
49 + }
48 50 }
49 51
50 52 if ( ! is_wp_error( $terms ) ) {
51 53 do_action_ref_array( 'betterdocs_layout_base_loop_start', [ & $terms, &$_defined_vars ] );
@@ -59,8 +61,14 @@
59 61 $docs_query_args = ! isset( $docs_query_args ) ? $_docs_query_args : wp_parse_args( $docs_query_args, $_docs_query_args );
60 62
61 63 $terms_count = count( $terms );
62 64 $terms_number = 1;
65 +
66 + $_term_ids = wp_list_pluck( $terms, 'term_id' );
67 + if ( ! empty( $_term_ids ) ) {
68 + update_termmeta_cache( $_term_ids );
69 + }
70 +
63 71 foreach ( $terms as $term ) {
64 72 $_counts = betterdocs()->query->get_docs_count(
65 73 $term,
66 74 $nested_subcategory,