PluginProbe ʕ •ᴥ•ʔ
ElementsKit Elementor Addons – Advanced Widgets & Templates Addons for Elementor / 4.0.0
ElementsKit Elementor Addons – Advanced Widgets & Templates Addons for Elementor v4.0.0
4.0.3 4.0.2 4.0.1 4.0.0 3.10.02 3.10.01 3.9.10 3.9.9 3.9.8 3.9.7 3.9.5 3.9.6 3.9.3 2.1.0 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.2.0 2.2.1 2.2.2 2.2.3 2.2.4 2.3.0 2.3.1 2.3.1.1 2.3.2 2.3.3 2.3.4 2.3.5 2.3.6 2.3.7 2.4.0 2.5.0 2.5.1 2.5.10 2.5.2 2.5.3 2.5.4 2.5.5 2.5.6 2.5.7 2.5.8 2.5.9 2.6.0 2.6.1 2.6.2 2.6.3 2.7.0 2.7.2 2.7.3 2.7.4 2.7.5 2.8.0 2.8.1 2.8.5 2.8.6 2.8.7 2.8.8 2.9.0 2.9.1 2.9.2 3.0.0 3.0.1 3.0.2 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.1.0 3.1.1 3.1.2 3.1.3 3.1.4 3.2.0 3.2.1 3.2.2 3.2.3 3.2.4 3.2.5 3.2.6 3.2.7 3.2.8 3.2.9 3.3.0 3.3.1 3.3.2 3.3.3 3.3.4 3.3.5 3.3.6 3.3.7 3.3.8 3.3.9 3.4.0 3.4.1 3.4.2 3.4.3 3.4.4 3.4.5 3.4.6 3.4.7 3.4.8 3.4.9 3.5.0 3.5.1 3.5.2 3.5.3 3.5.4 3.5.5 3.5.6 3.6.0 3.6.1 3.7.0 3.7.1 3.7.2 3.7.3 3.7.4 3.7.5 3.7.6 3.7.7 3.7.8 3.7.9 3.8.0 3.8.1 3.8.2 3.9.0 3.9.1 3.9.2 trunk 1.2.6 1.2.7 1.2.9 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.8 1.3.9 1.4.0 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.4.7 1.4.8 1.4.9 1.5.0 1.5.1 1.5.10 1.5.11 1.5.12 1.5.2 1.5.4 1.5.5 1.5.6 1.5.7 1.5.8 1.5.9 2.0.0 2.0.1 2.0.10 2.0.11 2.0.12 2.0.13 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.0.7 2.0.8 2.0.9 2.0.9.1 2.0.9.2 2.0.9.3
elementskit-lite / widgets / header-info / header-info.php
elementskit-lite / widgets / header-info Last commit date
header-info-handler.php 6 months ago header-info.php 3 weeks ago
header-info.php
288 lines
1 <?php
2 namespace Elementor;
3
4 use \Elementor\ElementsKit_Widget_Header_Info_Handler as Handler;
5 use \ElementsKit_Lite\Modules\Controls\Controls_Manager as ElementsKit_Controls_Manager;
6
7 defined('ABSPATH') || exit;
8
9 class ElementsKit_Widget_Header_Info extends Widget_Base
10 {
11 use \ElementsKit_Lite\Widgets\Widget_Notice;
12
13 public $base;
14
15 public function get_name() {
16 return Handler::get_name();
17 }
18
19 public function get_title() {
20 return Handler::get_title();
21 }
22
23 public function get_icon() {
24 return Handler::get_icon();
25 }
26
27 public function get_categories() {
28 return Handler::get_categories();
29 }
30
31 public function get_keywords() {
32 return Handler::get_keywords();
33 }
34
35 public function get_help_url() {
36 return 'https://wpmet.com/doc/header-info/';
37 }
38
39 public function get_style_depends() {
40 return ['ekit-header-info'];
41 }
42
43 protected function is_dynamic_content(): bool {
44 return false;
45 }
46
47 public function has_widget_inner_wrapper(): bool {
48 return ! Plugin::$instance->experiments->is_feature_active( 'e_optimized_markup' );
49 }
50
51 protected function register_controls()
52 {
53
54 $this->start_controls_section(
55 'ekit_header_info',
56 [
57 'label' => esc_html__('Header Info', 'elementskit-lite'),
58 ]
59 );
60
61 $headerinfogroup = new Repeater();
62 $headerinfogroup->add_control(
63 'ekit_headerinfo_icons',
64 [
65 'label' => esc_html__('Icon', 'elementskit-lite'),
66 'label_block' => true,
67 'type' => Controls_Manager::ICONS,
68 'default' => [
69 'value' => 'icon icon-map',
70 'library' => 'ekiticons',
71 ],
72
73 ]
74 );
75
76 $headerinfogroup->add_control(
77 'ekit_headerinfo_text',
78 [
79 'label' => esc_html__('Text', 'elementskit-lite'),
80 'label_block' => true,
81 'type' => Controls_Manager::TEXT,
82 'default' => '463 7th Ave, NY 10018, USA',
83 'dynamic' => [
84 'active' => true,
85 ],
86 ]
87 );
88 $headerinfogroup->add_control(
89 'ekit_headerinfo_link',
90 [
91 'label' => esc_html__( 'Link', 'elementskit-lite' ),
92 'type' => Controls_Manager::URL,
93 'placeholder' => esc_html__( 'https://wpmet.com', 'elementskit-lite' ),
94 'show_external' => true,
95 'default' => [
96 'url' => '',
97 'is_external' => true,
98 'nofollow' => true,
99 ],
100 'dynamic' => [
101 'active' => true,
102 ],
103 ]
104 );
105
106 $this->add_control(
107 'ekit_headerinfo_group',
108 [
109 'label' => esc_html__( 'Header Info', 'elementskit-lite' ),
110 'type' => Controls_Manager::REPEATER,
111 'fields' => $headerinfogroup->get_controls(),
112 'default' => [
113 [
114 'ekit_headerinfo_text' => esc_html__( '463 7th Ave, NY 10018, USA', 'elementskit-lite' ),
115 ],
116
117 ],
118 'title_field' => '{{{ ekit_headerinfo_text }}}',
119 ]
120 );
121
122 $this->end_controls_section();
123 $this->start_controls_section(
124 'ekit_header_icon_style',
125 [
126 'label' => esc_html__( 'Header Info', 'elementskit-lite' ),
127 'tab' => Controls_Manager::TAB_STYLE,
128 ]
129 );
130
131 $this->add_responsive_control(
132 'ekit_info_item_margin',
133 [
134 'label' => esc_html__( 'Margin', 'elementskit-lite' ),
135 'type' => Controls_Manager::DIMENSIONS,
136 'size_units' => [ 'px', '%', 'em' ],
137 'selectors' => [
138 '{{WRAPPER}} .ekit-header-info > li' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
139 ],
140 ]
141 );
142
143 $this->add_responsive_control(
144 'ekit_info_item_padding',
145 [
146 'label' => esc_html__( 'Padding', 'elementskit-lite' ),
147 'type' => Controls_Manager::DIMENSIONS,
148 'size_units' => [ 'px', '%', 'em' ],
149 'selectors' => [
150 '{{WRAPPER}} .ekit-header-info > li' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
151 ],
152 ]
153 );
154
155 $this->add_control(
156 'ekit_info_text_color',
157 [
158 'label' => esc_html__( 'Text Color', 'elementskit-lite' ),
159 'type' => Controls_Manager::COLOR,
160 'default' => '',
161 'selectors' => [
162 '{{WRAPPER}} .ekit-header-info > li > a' => 'color: {{VALUE}};',
163 ],
164 ]
165 );
166
167 $this->add_control(
168 'item_bg',
169 [
170 'label' => esc_html__( 'Background Color', 'elementskit-lite' ),
171 'type' => Controls_Manager::COLOR,
172 'selectors' => [
173 '{{WRAPPER}} .ekit-header-info > li' => 'background-color: {{VALUE}};',
174 ],
175 ]
176 );
177
178 $this->add_group_control(
179 Group_Control_Typography::get_type(),
180 [
181 'name' => 'elementskit_content_typography',
182 'label' => esc_html__( 'Typography', 'elementskit-lite' ),
183 'selector' => '{{WRAPPER}} .ekit-header-info > li > a',
184 ]
185 );
186
187 $this->add_control(
188 'icon',
189 [
190 'label' => __( 'Icon', 'elementskit-lite' ),
191 'type' => \Elementor\Controls_Manager::HEADING,
192 'separator' => 'before',
193 ]
194 );
195
196 $this->add_control(
197 'ekit_info_icon_color',
198 [
199 'label' => esc_html__( 'Icon Color', 'elementskit-lite' ),
200 'type' => Controls_Manager::COLOR,
201 'default' => '',
202 'selectors' => [
203 '{{WRAPPER}} .ekit-header-info > li > a i' => 'color: {{VALUE}};',
204 '{{WRAPPER}} .ekit-header-info > li > a svg' => 'fill: {{VALUE}};',
205 ],
206 ]
207 );
208 $this->add_responsive_control(
209 'ekit_simple_tab_title_icon_size',
210 [
211 'label' => esc_html__( 'Icon Size', 'elementskit-lite' ),
212 'type' => Controls_Manager::SLIDER,
213 'size_units' => [ 'px', '%' ],
214 'range' => [
215 'px' => [
216 'min' => 1,
217 'max' => 100,
218 'step' => 5,
219 ]
220 ],
221 'selectors' => [
222 '{{WRAPPER}} .ekit-header-info > li > a i' => 'font-size: {{SIZE}}{{UNIT}};',
223 '{{WRAPPER}} .ekit-header-info > li > a svg' => 'max-width: {{SIZE}}{{UNIT}}; height: auto',
224 ],
225 ]
226 );
227 $this->add_responsive_control(
228 'ekit_info_icon_spacing',
229 [
230 'label' => esc_html__( 'Icon Spacing', 'elementskit-lite' ),
231 'type' => Controls_Manager::SLIDER,
232 'default' => [
233 'size' => 10,
234 'unit' => 'px',
235 ],
236 'range' => [
237 'px' => [
238 'min' => 0,
239 'max' => 100,
240 ],
241 ],
242 'selectors' => [
243 '{{WRAPPER}} .ekit-header-info > li > a i, {{WRAPPER}} .ekit-header-info > li > a svg' => 'margin-right: {{SIZE}}{{UNIT}};',
244 ],
245 ]
246 );
247
248 $this->end_controls_section();
249
250 $this->insert_pro_message();
251 }
252
253
254 protected function render( ) {
255 echo '<div class="ekit-wid-con" >';
256 $this->render_raw();
257 echo '</div>';
258 }
259
260 protected function render_raw( ) {
261 $settings = $this->get_settings_for_display();
262 ?>
263 <ul class="ekit-header-info">
264 <?php
265 if ( $settings['ekit_headerinfo_group'] ){
266 foreach ( $settings['ekit_headerinfo_group'] as $key => $item ){
267 if ( ! empty( $item['ekit_headerinfo_link']['url'] ) ) {
268 $this->add_link_attributes( 'button-' . $key, $item['ekit_headerinfo_link'] );
269 }
270 ?>
271 <li>
272 <a <?php echo $this->get_render_attribute_string( 'button-' . $key ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Already escaped by elementor ?>>
273 <?php Icons_Manager::render_icon( $item['ekit_headerinfo_icons'], [ 'aria-hidden' => 'true' ] ); ?>
274 <?php echo esc_html($item['ekit_headerinfo_text']);?>
275 </a>
276 </li>
277
278 <?php
279
280
281 }
282 }
283 ?>
284 </ul>
285 <?php
286 }
287 }
288