| @@ -1,8 +1,13 @@ | ||
| 1 | 1 | <?php |
| 2 | +// phpcs:disable WordPress.DB.SlowDBQuery.slow_db_query_meta_key -- ordering by user-assigned meta is required UX. | |
| 3 | +namespace WPDeveloper\BetterDocs\Shortcodes; | |
| 2 | 4 | |
| 3 | -namespace WPDeveloper\BetterDocs\Shortcodes; | |
| 5 | +if ( ! defined( 'ABSPATH' ) ) { | |
| 6 | + exit; | |
| 7 | +} | |
| 4 | 8 | |
| 9 | + | |
| 5 | 10 | use WPDeveloper\BetterDocs\Core\Shortcode; |
| 6 | 11 | |
| 7 | 12 | class CategoryBox extends Shortcode { |
| 8 | 13 | protected $layout_class = 'layout-1'; |
| @@ -74,9 +79,9 @@ | ||
| 74 | 79 | $_query_args = [ |
| 75 | 80 | 'terms' => $this->attributes['terms'], |
| 76 | 81 | 'order' => $this->attributes['terms_order'], |
| 77 | 82 | 'orderby' => $this->attributes['terms_orderby'], |
| 78 | - 'multiple_kb' => $this->attributes['multiple_knowledge_base'], | |
| 83 | + 'multiple_kb' => ( $this->attributes['multiple_knowledge_base'] && ! empty( $this->attributes['kb_slug'] ) ) ? true : false, | |
| 79 | 84 | 'kb_slug' => $this->attributes['kb_slug'], |
| 80 | 85 | 'nested_subcategory' => (bool) $this->attributes['nested_subcategory'] |
| 81 | 86 | ]; |
| 82 | 87 | |