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 +3 -1 4.8.2 → 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 ] );