get( 'enable_live_search', true ) ) : ?>
⌘ K
get( 'enable_multiple_kb', false ); $post_type_obj = \Acumenon\Core\PostType::get_instance(); $terms = []; $current_kb_id = null; if ( $is_multi_kb ) { // Get the KB of the current post $kb_terms = wp_get_post_terms( $current_post_id, $post_type_obj->knowledge_base ); if ( ! empty( $kb_terms ) && ! is_wp_error( $kb_terms ) ) { $current_kb_id = $kb_terms[0]->term_id; // Get all posts inside this KB $kb_posts = get_posts( [ 'post_type' => $post_type_obj->post_type, 'posts_per_page' => -1, 'fields' => 'ids', 'tax_query' => [ [ 'taxonomy' => $post_type_obj->knowledge_base, 'field' => 'term_id', 'terms' => $current_kb_id ] ] ] ); // Extract unique categories across those posts if ( ! empty( $kb_posts ) ) { $terms = wp_get_object_terms( $kb_posts, $post_type_obj->category ); } } } else { // Standard logic $terms = get_terms( [ 'taxonomy' => $post_type_obj->category, 'hide_empty' => true, ] ); } if ( ! empty( $terms ) && ! is_wp_error( $terms ) ) { foreach ( $terms as $term ) { // Filter: Hide restricted category if ( ! \Acumenon\Core\AccessControl::can_user_access_term( $term->term_id, $post_type_obj->category ) ) { continue; } $tax_query = [ [ 'taxonomy' => $post_type_obj->category, 'field' => 'term_id', 'terms' => $term->term_id ] ]; if ( $current_kb_id ) { $tax_query[] = [ 'taxonomy' => $post_type_obj->knowledge_base, 'field' => 'term_id', 'terms' => $current_kb_id ]; $tax_query['relation'] = 'AND'; } $posts_in_term = get_posts( [ 'post_type' => $post_type_obj->post_type, 'posts_per_page' => -1, 'tax_query' => $tax_query ] ); $is_active_term = false; foreach ( $posts_in_term as $p ) { if ( $p->ID === $current_post_id ) { $is_active_term = true; break; } } $term_class = $is_active_term ? ' is-active' : ''; $display_style = $is_active_term ? 'display:block;' : 'display:none;'; ?>
name ); ?>
    ID ) ) { continue; } $active_post_class = ( $p->ID === $current_post_id ) ? 'active-post' : ''; ?>
> get( 'enable_breadcrumbs', true ) ) : ?>
/ get( 'docs_page_title', 'Knowledge Base' ) ); ?> / term_id, 'acmn_doc_category' ) ) { $first_term = $t; break; } } if ( $first_term ) { echo '' . esc_html( $first_term->name ) . ' / '; } } ?>
', '' ); ?>
get( 'enable_toc', true ) ) : ?>