← All changes
|
includes/elementor-widgets/property-availability.php
+37
-7
1.4.61
→
2.3.1
View file →
| @@ -14,9 +14,9 @@ | ||
| 14 | 14 | return __( 'Availability', 'propertyhive' ); |
| 15 | 15 | } |
| 16 | 16 | |
| 17 | 17 | public function get_icon() { |
| 18 | - return 'fa fa-tag'; | |
| 18 | + return 'eicon-meta-data'; | |
| 19 | 19 | } |
| 20 | 20 | |
| 21 | 21 | public function get_categories() { |
| 22 | 22 | return [ 'property-hive' ]; |
| @@ -25,9 +25,9 @@ | ||
| 25 | 25 | public function get_keywords() { |
| 26 | 26 | return [ 'property hive', 'propertyhive', 'property', 'availability', 'status' ]; |
| 27 | 27 | } |
| 28 | 28 | |
| 29 | - protected function _register_controls() { | |
| 29 | + protected function register_controls() { | |
| 30 | 30 | |
| 31 | 31 | $this->start_controls_section( |
| 32 | 32 | 'style_section', |
| 33 | 33 | [ |
| @@ -40,9 +40,11 @@ | ||
| 40 | 40 | \Elementor\Group_Control_Typography::get_type(), |
| 41 | 41 | [ |
| 42 | 42 | 'name' => 'typography', |
| 43 | 43 | 'label' => __( 'Typography', 'propertyhive' ), |
| 44 | - 'scheme' => \Elementor\Scheme_Typography::TYPOGRAPHY_1, | |
| 44 | + 'global' => [ | |
| 45 | + 'default' => \Elementor\Core\Kits\Documents\Tabs\Global_Typography::TYPOGRAPHY_PRIMARY, | |
| 46 | + ], | |
| 45 | 47 | 'selector' => '{{WRAPPER}} .elementor-widget-availability', |
| 46 | 48 | ] |
| 47 | 49 | ); |
| 48 | 50 | |
| @@ -50,11 +52,10 @@ | ||
| 50 | 52 | 'color', |
| 51 | 53 | [ |
| 52 | 54 | 'label' => __( 'Colour', 'propertyhive' ), |
| 53 | 55 | 'type' => \Elementor\Controls_Manager::COLOR, |
| 54 | - 'scheme' => [ | |
| 55 | - 'type' => \Elementor\Scheme_Color::get_type(), | |
| 56 | - 'value' => \Elementor\Scheme_Color::COLOR_1, | |
| 56 | + 'global' => [ | |
| 57 | + 'default' => \Elementor\Core\Kits\Documents\Tabs\Global_Colors::COLOR_PRIMARY, | |
| 57 | 58 | ], |
| 58 | 59 | 'selectors' => [ |
| 59 | 60 | '{{WRAPPER}} .elementor-widget-availability' => 'color: {{VALUE}}', |
| 60 | 61 | ], |
| @@ -60,8 +61,35 @@ | ||
| 60 | 61 | ], |
| 61 | 62 | ] |
| 62 | 63 | ); |
| 63 | 64 | |
| 65 | + $this->add_control( | |
| 66 | + 'text_align', | |
| 67 | + [ | |
| 68 | + 'label' => __( 'Alignment', 'propertyhive' ), | |
| 69 | + 'type' => \Elementor\Controls_Manager::CHOOSE, | |
| 70 | + 'options' => [ | |
| 71 | + 'left' => [ | |
| 72 | + 'title' => __( 'Left', 'propertyhive' ), | |
| 73 | + 'icon' => 'eicon-text-align-left', | |
| 74 | + ], | |
| 75 | + 'center' => [ | |
| 76 | + 'title' => __( 'Center', 'propertyhive' ), | |
| 77 | + 'icon' => 'eicon-text-align-center', | |
| 78 | + ], | |
| 79 | + 'right' => [ | |
| 80 | + 'title' => __( 'Right', 'propertyhive' ), | |
| 81 | + 'icon' => 'eicon-text-align-right', | |
| 82 | + ], | |
| 83 | + ], | |
| 84 | + 'default' => 'left', | |
| 85 | + 'toggle' => true, | |
| 86 | + 'selectors' => [ | |
| 87 | + '{{WRAPPER}} .elementor-widget-availability' => 'text-align: {{VALUE}}', | |
| 88 | + ], | |
| 89 | + ] | |
| 90 | + ); | |
| 91 | + | |
| 64 | 92 | $this->end_controls_section(); |
| 65 | 93 | |
| 66 | 94 | } |
| 67 | 95 | |
| @@ -76,10 +104,12 @@ | ||
| 76 | 104 | } |
| 77 | 105 | |
| 78 | 106 | if ( $property->availability != '' ) |
| 79 | 107 | { |
| 80 | - echo '<div class="elementor-widget-availability">' . $property->availability . '</div>'; | |
| 108 | + $this->add_render_attribute( '_wrapper', 'data-availability', esc_attr($property->availability) ); | |
| 109 | + | |
| 110 | + echo '<div class="elementor-widget-availability">' . esc_html($property->availability) . '</div>'; | |
| 81 | 111 | } |
| 82 | 112 | |
| 83 | 113 | } |
| 84 | 114 | |
| 85 | 115 | } |