PluginProbe
BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot / 2.0.1
BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot v2.0.1
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
betterdocs / includes / gutenberg / template / category-grid / Nested_Subcategory.php

Nested_Subcategory.php in BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot 2.0.1, at includes/gutenberg/template/category-grid/Nested_Subcategory.php

46 lines 1.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 $sub_categories = BetterDocs_Helper::child_taxonomy_terms($term_id, false, $orderBy, $order, '');
4
5 if ($sub_categories) {
6 foreach ($sub_categories as $sub_category) {
7 $html .= '<span class="elgb-betterdocs-grid-sub-cat-title">';
8 $html .= '<i class="fas fa-angle-right toggle-arrow arrow-right"></i><i class="fas fa-angle-down toggle-arrow arrow-down"></i>';
9 $html .= '<a href="javascript:void(0);">' . $sub_category->name . '</a></span>';
10 $html .= '<div class="docs-sub-cat-wrapper"><ul class="docs-sub-cat-list">';
11
12 $sub_args = array(
13 'post_type' => 'docs',
14 'post_status' => 'publish'
15 );
16
17 $tax_query = array(
18 array(
19 'taxonomy' => 'doc_category',
20 'field' => 'slug',
21 'terms' => $sub_category->slug,
22 'operator' => 'AND',
23 'include_children' => false
24 ),
25 );
26
27 $sub_args['posts_per_page'] = $postPerSubcategory;
28
29 $sub_args['tax_query'] = apply_filters('betterdocs_list_tax_query_arg', $tax_query, $multiple_kb, $sub_category->slug, '');
30
31 $sub_post_query = new \WP_Query($sub_args);
32 if ($sub_post_query->have_posts()) :
33 while ($sub_post_query->have_posts()) : $sub_post_query->the_post();
34 $sub_attr = ['href="' . get_the_permalink() . '"'];
35 $html .= '<li class="sub-list">';
36
37 $html .= '<i class="' . $listIcon . ' el-betterdocs-cg-post-list-icon"></i>';
38
39 $html .= '<a ' . implode(' ', $sub_attr) . '>' . get_the_title() . '</a></li>';
40 endwhile;
41 endif;
42 wp_reset_query();
43 $html .= '</ul></div>';
44 }
45 }
46