custom-grid.php
51 lines
| 1 | <?php |
| 2 | |
| 3 | |
| 4 | use ElementorPro\Modules\ThemeBuilder\Module; |
| 5 | use ElementorPro\Core\Utils; |
| 6 | use ElementorPro\Modules\ThemeBuilder\Conditions\Post; |
| 7 | |
| 8 | if ( ! defined( 'ABSPATH' ) ) { |
| 9 | exit; // Exit if accessed directly |
| 10 | } |
| 11 | |
| 12 | class ECS_Custom_Grid_Conditions extends ElementorPro\Modules\ThemeBuilder\Conditions\Condition_Base { |
| 13 | |
| 14 | protected $sub_conditions = []; |
| 15 | |
| 16 | public static function get_type() { |
| 17 | return 'custom_grid'; |
| 18 | } |
| 19 | |
| 20 | public function get_name() { |
| 21 | return 'custom_grid'; |
| 22 | } |
| 23 | |
| 24 | public static function get_priority() { |
| 25 | return 60; |
| 26 | } |
| 27 | |
| 28 | public function get_label() { |
| 29 | return __( 'Custom Grid', 'ele-custom-skin' ); |
| 30 | } |
| 31 | |
| 32 | public function get_all_label() { |
| 33 | return __( 'No Conditions', 'ele-custom-skin' ); |
| 34 | } |
| 35 | |
| 36 | public function register_sub_conditions() { |
| 37 | // Last condition. |
| 38 | $this->sub_conditions[] = 'not_found404'; |
| 39 | |
| 40 | } |
| 41 | |
| 42 | public function check( $args ) { |
| 43 | return false; |
| 44 | } |
| 45 | } |
| 46 | |
| 47 | add_action( 'elementor/theme/register_conditions', function( $conditions_manager ) { |
| 48 | $conditions_manager->get_condition('general')->register_sub_condition( new ECS_Custom_Grid_Conditions() ); |
| 49 | |
| 50 | },100); |
| 51 |