PluginProbe
BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot / 4.9.2
BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot v4.9.2
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 3.5.1 All 200 releases
← All changes | views/widgets/breadcrumbs.php +21 -1 4.4.04.9.2 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 ( is_front_page() ) {
3 8 return;
4 9 }
5 10 $breadcrumbs_layout = isset( $breadcrumbs_layout ) ? $breadcrumbs_layout : 'layout-1';
@@ -44,9 +49,14 @@
44 49 unset($breadcrumbs[0]);
45 50 }
46 51
47 52 $breadcrumbs = apply_filters( 'betterdocs_breadcrumb_before_archives', $breadcrumbs );
48 - if ( $taxanomy == 'doc_category' || is_tax( 'doc_tag' ) ) {
53 +
54 + // Detect the current archive taxonomy via the queried object (reliable in Elementor theme builder context)
55 + $_queried_obj = get_queried_object();
56 + $_is_doc_tag = $_queried_obj instanceof \WP_Term && $_queried_obj->taxonomy === 'doc_tag';
57 +
58 + if ( $taxanomy == 'doc_category' ) {
49 59 if ( $enable_breadcrumb_category ) {
50 60 $query_obj = get_queried_object();
51 61 $term_id = $query_obj->term_id;
52 62
@@ -54,8 +64,18 @@
54 64 if ( ! is_wp_error( $term_parents ) && is_array( $term_parents ) ) {
55 65 $breadcrumbs = apply_filters( 'betterdocs_breadcrumb_after_archives', array_merge( $breadcrumbs, $term_parents ) );
56 66 }
57 67 }
68 + } elseif ( $_is_doc_tag ) {
69 + // Always append the current tag name: Home > Docs > Tag Title
70 + $tag_crumb = [
71 + [
72 + 'li_classes' => [ 'item-current', 'item-tag-' . esc_attr( $_queried_obj->term_id ), 'current' ],
73 + 'url' => '',
74 + 'text' => $_queried_obj->name,
75 + ],
76 + ];
77 + $breadcrumbs = apply_filters( 'betterdocs_breadcrumb_after_archives', array_merge( $breadcrumbs, $tag_crumb ) );
58 78 } elseif ( is_single() ) {
59 79 global $wp_query, $post;
60 80
61 81 if ( $enable_breadcrumb_category ) {