PluginProbe
BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot / 3.8.9
BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot v3.8.9
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 | includes/Shortcodes/CategoryBox.php +91 -91 3.4.23.8.9 View file →
@@ -4,117 +4,117 @@
4 4
5 5 use WPDeveloper\BetterDocs\Core\Shortcode;
6 6
7 7 class CategoryBox extends Shortcode {
8 - protected $layout_class = 'layout-1';
9 - protected $deprecated_attributes = [
10 - 'category' => 'taxonomy',
11 - 'icon' => 'show_icon'
12 - ];
8 + protected $layout_class = 'layout-1';
9 + protected $deprecated_attributes = [
10 + 'category' => 'taxonomy',
11 + 'icon' => 'show_icon'
12 + ];
13 13
14 - public function get_name() {
15 - return 'betterdocs_category_box';
16 - }
14 + public function get_name() {
15 + return 'betterdocs_category_box';
16 + }
17 17
18 - public function get_style_depends(){
19 - return [ 'betterdocs-category-box' ];
20 - }
18 + public function get_style_depends() {
19 + return [ 'betterdocs-category-box' ];
20 + }
21 21
22 - public function default_attributes() {
23 - return [
24 - 'taxonomy' => 'doc_category',
25 - 'parent' => 0,
26 - 'meta_key' => '',
27 - 'layout' => '',
28 - 'column' => $this->settings->get( 'column_number', 3 ),
29 - 'orderby' => $this->settings->get( 'alphabetically_order_post', 'title' ),
30 - 'nested_subcategory' => (bool) $this->settings->get( 'nested_subcategory', false ),
31 - 'terms' => '',
32 - 'terms_order' => $this->settings->get( 'terms_order', 'ASC' ),
33 - 'terms_orderby' => $this->settings->get( 'terms_orderby', 'betterdocs_order' ),
34 - 'show_icon' => true,
35 - 'kb_slug' => '',
36 - 'title_tag' => 'h2',
37 - 'multiple_knowledge_base' => false,
38 - 'disable_customizer_style' => false,
39 - 'border_bottom' => false,
40 - 'show_description' => (bool) $this->customizer->get( 'betterdocs_doc_page_cat_desc', false )
41 - ];
42 - }
22 + public function default_attributes() {
23 + return [
24 + 'taxonomy' => 'doc_category',
25 + 'parent' => 0,
26 + 'meta_key' => '',
27 + 'layout' => '',
28 + 'column' => $this->settings->get( 'column_number', 3 ),
29 + 'orderby' => $this->settings->get( 'alphabetically_order_post', 'title' ),
30 + 'nested_subcategory' => (bool) $this->settings->get( 'nested_subcategory', false ),
31 + 'terms' => '',
32 + 'terms_order' => $this->settings->get( 'terms_order', 'ASC' ),
33 + 'terms_orderby' => $this->settings->get( 'terms_orderby', 'betterdocs_order' ),
34 + 'show_icon' => true,
35 + 'kb_slug' => '',
36 + 'title_tag' => 'h2',
37 + 'multiple_knowledge_base' => false,
38 + 'disable_customizer_style' => false,
39 + 'border_bottom' => false,
40 + 'show_description' => (bool) $this->customizer->get( 'betterdocs_doc_page_cat_desc', false )
41 + ];
42 + }
43 43
44 - public function header_sequence( $_layout_sequence, $layout, $widget_type, $_defined_vars ) {
45 - return ['category_icon', 'category_title', 'category_description', 'category_counts'];
46 - }
44 + public function header_sequence( $_layout_sequence, $layout, $widget_type, $_defined_vars ) {
45 + return [ 'category_icon', 'category_title', 'category_description', 'category_counts' ];
46 + }
47 47
48 - public function render( $atts, $content = null ) {
49 - add_filter( 'betterdocs_header_layout_sequence', [$this, 'header_sequence'], 10, 4 );
48 + public function render( $atts, $content = null ) {
49 + add_filter( 'betterdocs_header_layout_sequence', [ $this, 'header_sequence' ], 10, 4 );
50 50
51 - $this->views( 'layouts/base' );
51 + $this->views( 'layouts/base' );
52 52
53 - remove_filter( 'betterdocs_header_layout_sequence', [$this, 'header_sequence'], 10 );
54 - }
53 + remove_filter( 'betterdocs_header_layout_sequence', [ $this, 'header_sequence' ], 10 );
54 + }
55 55
56 - public function view_params() {
57 - $classes = [ 'betterdocs-category-box-inner-wrapper ash-bg layout-flex', $this->layout_class ];
58 - $styles = '';
56 + public function view_params() {
57 + $classes = [ 'betterdocs-category-box-inner-wrapper', $this->layout_class, ( $this->layout_class != 'layout-4' ? 'layout-flex ash-bg' : '' ) ];
58 + $styles = '';
59 59
60 - if ( $this->isset( 'column' ) ) {
61 - $_c = intval( $this->attributes['column'] );
62 - $classes[] = 'docs-col-' . $_c;
63 - $styles .= "--column: $_c;";
64 - }
60 + if ( $this->isset( 'column' ) ) {
61 + $_c = intval( $this->attributes['column'] );
62 + $classes[] = 'docs-col-' . $_c;
63 + $styles .= "--column: $_c;";
64 + }
65 65
66 - if ( $this->isset( 'border_bottom', true ) ) {
67 - $classes[] = 'border-bottom';
68 - }
66 + if ( $this->isset( 'border_bottom', true ) ) {
67 + $classes[] = 'border-bottom';
68 + }
69 69
70 - if ( $this->isset( 'disable_customizer_style', false ) ) {
71 - $classes[] = 'single-kb';
72 - }
70 + if ( $this->isset( 'disable_customizer_style', false ) ) {
71 + $classes[] = 'single-kb';
72 + }
73 73
74 - $_query_args = [
75 - 'terms' => $this->attributes['terms'],
76 - 'order' => $this->attributes['terms_order'],
77 - 'orderby' => $this->attributes['terms_orderby'],
78 - 'multiple_kb' => $this->attributes['multiple_knowledge_base'],
79 - 'kb_slug' => $this->attributes['kb_slug'],
80 - 'nested_subcategory' => (bool) $this->attributes['nested_subcategory']
81 - ];
74 + $_query_args = [
75 + 'terms' => $this->attributes['terms'],
76 + 'order' => $this->attributes['terms_order'],
77 + 'orderby' => $this->attributes['terms_orderby'],
78 + 'multiple_kb' => $this->attributes['multiple_knowledge_base'],
79 + 'kb_slug' => $this->attributes['kb_slug'],
80 + 'nested_subcategory' => (bool) $this->attributes['nested_subcategory']
81 + ];
82 82
83 - if ( $this->isset( 'taxonomy' ) ) {
84 - $_query_args['taxonomy'] = $this->attributes['taxonomy'];
85 - }
83 + if ( $this->isset( 'taxonomy' ) ) {
84 + $_query_args['taxonomy'] = $this->attributes['taxonomy'];
85 + }
86 86
87 - // if ( $this->isset( 'parent', 0 ) ) {
88 - // $_query_args['parent'] = $this->attributes['parent'];
89 - // }
87 + // if ( $this->isset( 'parent', 0 ) ) {
88 + // $_query_args['parent'] = $this->attributes['parent'];
89 + // }
90 90
91 - if ( $this->isset( 'meta_key' ) ) {
92 - $_query_args['meta_key'] = $this->attributes['meta_key'];
93 - }
91 + if ( $this->isset( 'meta_key' ) ) {
92 + $_query_args['meta_key'] = $this->attributes['meta_key'];
93 + }
94 94
95 - $terms_query = $this->query->terms_query( $_query_args );
95 + $terms_query = $this->query->terms_query( $_query_args );
96 96
97 - $show_count = (bool) $this->settings->get( 'post_count', false );
98 - $singular_text = $this->settings->get( 'count_text_singular', __( 'article', 'betterdocs' ) );
99 - $plural_text = $this->settings->get( 'count_text', __( 'articles', 'betterdocs' ) );
97 + $show_count = (bool) $this->settings->get( 'post_count', false );
98 + $singular_text = $this->settings->get( 'count_text_singular' );
99 + $plural_text = $this->settings->get( 'count_text' );
100 100
101 - $inner_wrapper_attr = [
102 - 'class' => $classes,
103 - 'style' => $styles,
104 - ];
101 + $inner_wrapper_attr = [
102 + 'class' => $classes,
103 + 'style' => $styles,
104 + ];
105 105
106 - return [
107 - 'wrapper_attr' => ['class' => ['betterdocs-category-box-wrapper']],
108 - 'inner_wrapper_attr' => $inner_wrapper_attr,
109 - 'layout' => 'default',
110 - 'widget_type' => 'category-box',
106 + return [
107 + 'wrapper_attr' => [ 'class' => [ 'betterdocs-category-box-wrapper' ] ],
108 + 'inner_wrapper_attr' => $inner_wrapper_attr,
109 + 'layout' => 'default',
110 + 'widget_type' => 'category-box',
111 111
112 - 'terms_query_args' => $terms_query,
112 + 'terms_query_args' => $terms_query,
113 113
114 - 'show_title' => true,
115 - 'show_count' => $show_count,
116 - 'count_suffix_singular' => $singular_text,
117 - 'count_suffix' => $plural_text
118 - ];
119 - }
114 + 'show_title' => true,
115 + 'show_count' => $show_count,
116 + 'count_suffix_singular' => $singular_text,
117 + 'count_suffix' => $plural_text
118 + ];
119 + }
120 120 }