PluginProbe
Property Hive / 2.3.0
Property Hive v2.3.0
2.3.0 2.2.6 2.2.5 2.2.4 2.2.3 2.2.2 1.4.46 1.4.47 1.4.48 1.4.49 1.4.5 1.4.50 1.4.51 1.4.52 1.4.53 1.4.54 1.4.55 1.4.56 1.4.57 1.4.58 1.4.59 1.4.6 1.4.60 1.4.61 1.4.62 All 260 releases
propertyhive / includes / elementor-widgets / property-summary-description.php

property-summary-description.php in Property Hive 2.3.0, at includes/elementor-widgets/property-summary-description.php

136 lines 3.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Elementor Property Summary Description Widget.
4 *
5 * @since 1.0.0
6 */
7 class Elementor_Property_Summary_Description_Widget extends \Elementor\Widget_Base {
8
9 public function get_name() {
10 return 'property-summary-description';
11 }
12
13 public function get_title() {
14 return __( 'Summary Description', 'propertyhive' );
15 }
16
17 public function get_icon() {
18 return 'eicon-text';
19 }
20
21 public function get_categories() {
22 return [ 'property-hive' ];
23 }
24
25 public function get_keywords() {
26 return [ 'property hive', 'propertyhive', 'property', 'summary', 'description', 'excerpt' ];
27 }
28
29 protected function register_controls() {
30
31 $this->start_controls_section(
32 'style_section',
33 [
34 'label' => __( 'Summary Description', 'propertyhive' ),
35 'tab' => \Elementor\Controls_Manager::TAB_STYLE,
36 ]
37 );
38
39 $this->add_control(
40 'show_title',
41 [
42 'label' => __( 'Show Title', 'propertyhive' ),
43 'type' => \Elementor\Controls_Manager::SWITCHER,
44 'label_on' => __( 'Show', 'propertyhive' ),
45 'label_off' => __( 'Hide', 'propertyhive' ),
46 'return_value' => 'yes',
47 'default' => 'yes',
48 ]
49 );
50
51 $this->add_group_control(
52 \Elementor\Group_Control_Typography::get_type(),
53 [
54 'name' => 'title_typography',
55 'label' => __( 'Title Typography', 'propertyhive' ),
56 'global' => [
57 'default' => \Elementor\Core\Kits\Documents\Tabs\Global_Typography::TYPOGRAPHY_PRIMARY,
58 ],
59 'selector' => '{{WRAPPER}} .summary h4',
60 'condition' => [
61 'show_title' => 'yes'
62 ],
63 ]
64 );
65
66 $this->add_control(
67 'title_color',
68 [
69 'label' => __( 'Title Colour', 'propertyhive' ),
70 'type' => \Elementor\Controls_Manager::COLOR,
71 'global' => [
72 'default' => \Elementor\Core\Kits\Documents\Tabs\Global_Colors::COLOR_PRIMARY,
73 ],
74 'selectors' => [
75 '{{WRAPPER}} .summary h4' => 'color: {{VALUE}}',
76 ],
77 'condition' => [
78 'show_title' => 'yes'
79 ],
80 ]
81 );
82
83 $this->add_group_control(
84 \Elementor\Group_Control_Typography::get_type(),
85 [
86 'name' => 'summary_typography',
87 'label' => __( 'Summary Typography', 'propertyhive' ),
88 'global' => [
89 'default' => \Elementor\Core\Kits\Documents\Tabs\Global_Typography::TYPOGRAPHY_PRIMARY,
90 ],
91 'selector' => '{{WRAPPER}} .summary .summary-contents',
92 ]
93 );
94
95 $this->add_control(
96 'summary_color',
97 [
98 'label' => __( 'Summary Colour', 'propertyhive' ),
99 'type' => \Elementor\Controls_Manager::COLOR,
100 'global' => [
101 'default' => \Elementor\Core\Kits\Documents\Tabs\Global_Colors::COLOR_PRIMARY,
102 ],
103 'selectors' => [
104 '{{WRAPPER}} .summary .summary-contents' => 'color: {{VALUE}}',
105 ],
106 ]
107 );
108
109 $this->end_controls_section();
110
111 }
112
113 protected function render() {
114
115 global $property;
116
117 $settings = $this->get_settings_for_display();
118
119 if ( !isset($property->id) ) {
120 return;
121 }
122
123 if ( isset($settings['show_title']) && $settings['show_title'] != 'yes' )
124 {
125 ?>
126 <style type="text/css">
127 .summary h4 { display:none; }
128 </style>
129 <?php
130 }
131
132 propertyhive_template_single_summary();
133
134 }
135
136 }