← All changes
|
includes/Editors/Elementor/Conditions/ArchiveCondition.php
+40
-35
3.4.2
→
4.9.3
View file →
| @@ -1,9 +1,9 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | namespace WPDeveloper\BetterDocs\Editors\Elementor\Conditions; |
| 3 | 3 | |
| 4 | 4 | if ( ! defined( 'ABSPATH' ) ) { |
| 5 | - exit; // Exit if accessed directly | |
| 5 | + exit; // Exit if accessed directly | |
| 6 | 6 | } |
| 7 | 7 | |
| 8 | 8 | use ElementorPro\Modules\ThemeBuilder\Conditions\Taxonomy; |
| 9 | 9 | use ElementorPro\Modules\ThemeBuilder\Conditions\Condition_Base; |
| @@ -8,48 +8,53 @@ | ||
| 8 | 8 | use ElementorPro\Modules\ThemeBuilder\Conditions\Taxonomy; |
| 9 | 9 | use ElementorPro\Modules\ThemeBuilder\Conditions\Condition_Base; |
| 10 | 10 | |
| 11 | 11 | class ArchiveCondition extends Condition_Base { |
| 12 | - private $post_type = 'docs'; | |
| 13 | - private $post_taxonomies; | |
| 12 | + private $post_type = 'docs'; | |
| 13 | + private $post_taxonomies; | |
| 14 | 14 | |
| 15 | - public function __construct( array $data = [] ) { | |
| 16 | - $taxonomies = get_object_taxonomies( $this->post_type, 'objects' ); | |
| 15 | + public function __construct( array $data = [] ) { | |
| 16 | + $taxonomies = get_object_taxonomies( $this->post_type, 'objects' ); | |
| 17 | 17 | |
| 18 | - $this->post_taxonomies = wp_filter_object_list( $taxonomies, [ | |
| 19 | - 'public' => true, | |
| 20 | - 'show_in_nav_menus' => true | |
| 21 | - ] ); | |
| 18 | + $this->post_taxonomies = wp_filter_object_list( | |
| 19 | + $taxonomies, | |
| 20 | + [ | |
| 21 | + 'public' => true, | |
| 22 | + 'show_in_nav_menus' => true | |
| 23 | + ] | |
| 24 | + ); | |
| 22 | 25 | |
| 23 | - parent::__construct( $data ); | |
| 24 | - } | |
| 26 | + parent::__construct( $data ); | |
| 27 | + } | |
| 25 | 28 | |
| 26 | - public static function get_type() { | |
| 27 | - return 'archive'; | |
| 28 | - } | |
| 29 | + public static function get_type() { | |
| 30 | + return 'archive'; | |
| 31 | + } | |
| 29 | 32 | |
| 30 | - public function get_name() { | |
| 31 | - return 'doc_archive'; | |
| 32 | - } | |
| 33 | + public function get_name() { | |
| 34 | + return 'doc_archive'; | |
| 35 | + } | |
| 33 | 36 | |
| 34 | - public function get_label() { | |
| 35 | - return __( 'Docs Archive', 'betterdocs' ); | |
| 36 | - } | |
| 37 | + public function get_label() { | |
| 38 | + return __( 'Docs Archive', 'betterdocs' ); | |
| 39 | + } | |
| 37 | 40 | |
| 38 | - public function get_all_label() { | |
| 39 | - return __( 'All Docs Archive', 'betterdocs' ); | |
| 40 | - } | |
| 41 | + public function get_all_label() { | |
| 42 | + return __( 'All Docs Archive', 'betterdocs' ); | |
| 43 | + } | |
| 41 | 44 | |
| 42 | - public function register_sub_conditions() { | |
| 43 | - $this->register_sub_condition( new DocsPage() ); | |
| 44 | - foreach ( $this->post_taxonomies as $slug => $object ) { | |
| 45 | - $condition = new Taxonomy( [ | |
| 46 | - 'object' => $object | |
| 47 | - ] ); | |
| 48 | - $this->register_sub_condition( $condition ); | |
| 49 | - } | |
| 50 | - } | |
| 45 | + public function register_sub_conditions() { | |
| 46 | + $this->register_sub_condition( new DocsPage() ); | |
| 47 | + foreach ( $this->post_taxonomies as $slug => $object ) { | |
| 48 | + $condition = new Taxonomy( | |
| 49 | + [ | |
| 50 | + 'object' => $object | |
| 51 | + ] | |
| 52 | + ); | |
| 53 | + $this->register_sub_condition( $condition ); | |
| 54 | + } | |
| 55 | + } | |
| 51 | 56 | |
| 52 | - public function check( $args ) { | |
| 53 | - return is_post_type_archive( 'docs' ) || is_tax( 'knowledge_base' ) || is_tax( 'doc_category' ) || is_tax( 'doc_tag' ); | |
| 54 | - } | |
| 57 | + public function check( $args ) { | |
| 58 | + return is_post_type_archive( 'docs' ) || is_tax( 'knowledge_base' ) || is_tax( 'doc_category' ) || is_tax( 'doc_tag' ) || is_tax('glossaries'); | |
| 59 | + } | |
| 55 | 60 | } |