| @@ -1,8 +1,13 @@ | ||
| 1 | 1 | <?php |
| 2 | +// phpcs:disable WordPressVIPMinimum.Performance.WPQueryParams.PostNotIn_exclude -- shortcode exposes user-driven exclusion attribute. | |
| 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\Utils\Helper; |
| 6 | 11 | use WPDeveloper\BetterDocs\Core\Shortcode; |
| 7 | 12 | |
| 8 | 13 | class CategoryGridThree extends Shortcode { |
| @@ -100,9 +105,9 @@ | ||
| 100 | 105 | |
| 101 | 106 | $terms_query = $this->query->terms_query( |
| 102 | 107 | [ |
| 103 | 108 | 'taxonomy' => $this->attributes['taxonomy'], |
| 104 | - 'multiple_kb' => $this->attributes['multiple_knowledge_base'], | |
| 109 | + 'multiple_kb' => ( $this->attributes['multiple_knowledge_base'] && ! empty( $this->attributes['kb_slug'] ) ) ? true : false, | |
| 105 | 110 | 'kb_slug' => $this->attributes['kb_slug'], |
| 106 | 111 | 'terms' => $this->attributes['terms'], |
| 107 | 112 | 'order' => $this->attributes['terms_order'], |
| 108 | 113 | 'orderby' => $this->attributes['terms_orderby'] |