PluginProbe ʕ •ᴥ•ʔ
Shortcodes and extra features for Phlox theme / 2.17.4
Shortcodes and extra features for Phlox theme v2.17.4
2.17.21 2.17.20 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.0.6 1.0.9 1.1.0 1.3.0 1.3.1 1.3.10 1.3.14 1.3.2 1.3.3 1.3.6 1.4.0 1.4.1 1.4.2 1.5.0 1.5.2 1.6.0 1.6.2 1.6.4 1.7.0 1.7.2 2.10.0 2.10.1 2.10.3 2.10.5 2.10.7 2.10.8 2.10.9 2.11.0 2.11.1 2.11.2 2.12.0 2.14.0 2.15.0 2.15.2 2.15.4 2.15.5 2.15.6 2.15.7 2.15.8 2.15.9 2.16.0 2.16.1 2.16.2 2.16.3 2.16.4 2.17.0 2.17.1 2.17.12 2.17.13 2.17.14 2.17.15 2.17.16 2.17.2 2.17.3 2.17.4 2.17.5 2.17.6 2.17.8 2.17.9 2.4.12 2.4.13 2.4.14 2.4.16 2.4.18 2.4.19 2.4.9 2.5.0 2.5.1 2.5.10 2.5.11 2.5.12 2.5.13 2.5.14 2.5.15 2.5.16 2.5.17 2.5.19 2.5.2 2.5.20 2.5.3 2.5.7 2.5.8 2.5.9 2.6.0 2.6.1 2.6.10 2.6.12 2.6.13 2.6.14 2.6.15 2.6.16 2.6.17 2.6.19 2.6.2 2.6.20 2.6.4 2.6.5 2.6.7 2.7.0 2.7.1 2.7.10 2.7.11 2.7.12 2.7.13 2.7.14 2.7.2 2.7.3 2.7.4 2.7.5 2.7.6 2.7.7 2.7.8 2.7.9 2.8.0 2.8.1 2.8.2 2.8.3 2.8.4 2.8.5 2.8.6 2.8.7 2.8.9 2.9.0 2.9.12 2.9.14 2.9.15 2.9.16 2.9.17 2.9.18 2.9.19 2.9.2 2.9.20 2.9.21 2.9.22 2.9.3 2.9.4 2.9.5 2.9.6 2.9.7 2.9.8
auxin-elements / includes / elementor / widgets / theme-elements / site-title.php
auxin-elements / includes / elementor / widgets / theme-elements Last commit date
breadcrumbs.php 1 year ago copyright.php 1 year ago current-time.php 1 year ago logo.php 1 year ago menu.php 1 year ago modern-search.php 1 year ago search.php 1 year ago select.php 1 year ago shopping-cart.php 1 year ago site-title.php 1 year ago
site-title.php
525 lines
1 <?php
2 namespace Auxin\Plugin\CoreElements\Elementor\Elements\Theme_Elements;
3
4 use Elementor\Plugin;
5 use Elementor\Widget_Base;
6 use Elementor\Controls_Manager;
7 use Elementor\Group_Control_Typography;
8 use Elementor\Core\Kits\Documents\Tabs\Global_Typography;
9 use Elementor\Group_Control_Text_Shadow;
10
11
12 if ( ! defined( 'ABSPATH' ) ) {
13 exit; // Exit if accessed directly.
14 }
15
16 /**
17 * Elementor 'SiteTitle' widget.
18 *
19 * Elementor widget that displays an 'SiteTitle'.
20 *
21 * @since 1.0.0
22 */
23 class SiteTitle extends Widget_Base {
24
25 /**
26 * Get widget name.
27 *
28 * Retrieve 'SiteTitle' widget name.
29 *
30 * @since 1.0.0
31 * @access public
32 *
33 * @return string Widget name.
34 */
35 public function get_name() {
36 return 'aux_site_title';
37 }
38
39 /**
40 * Get widget title.
41 *
42 * Retrieve 'SiteTitle' widget title.
43 *
44 * @since 1.0.0
45 * @access public
46 *
47 * @return string Widget title.
48 */
49 public function get_title() {
50 return __('Site Title', 'auxin-elements' );
51 }
52
53 /**
54 * Get widget icon.
55 *
56 * Retrieve 'SiteTitle' widget icon.
57 *
58 * @since 1.0.0
59 * @access public
60 *
61 * @return string Widget icon.
62 */
63 public function get_icon() {
64 return 'eicon-site-title auxin-badge';
65 }
66
67 /**
68 * Get widget categories.
69 *
70 * Retrieve 'SiteTitle' widget icon.
71 *
72 * @since 1.0.0
73 * @access public
74 *
75 * @return string Widget icon.
76 */
77 public function get_categories() {
78 return array( 'auxin-core', 'auxin-theme-elements' );
79 }
80
81 /**
82 * Register 'SiteTitle' widget controls.
83 *
84 * Adds different input fields to allow the user to change and customize the widget settings.
85 *
86 * @since 1.0.0
87 * @access protected
88 */
89 protected function register_controls() {
90
91 $this->start_controls_section(
92 'title_section',
93 array(
94 'label' => __('Title', 'auxin-elements' ),
95 )
96 );
97
98 $this->add_control(
99 'title_tag',
100 array(
101 'label' => __( 'Site Title HTML Tag', 'auxin-elements' ),
102 'type' => Controls_Manager::SELECT,
103 'options' => array(
104 'h1' => 'H1',
105 'h2' => 'H2',
106 'h3' => 'H3',
107 'h4' => 'H4',
108 'h5' => 'H5',
109 'h6' => 'H6',
110 'div' => 'Div',
111 'span' => 'Span',
112 'p' => 'P',
113 ),
114 'default' => 'h1',
115 'separator' => 'after'
116 )
117 );
118
119 $this->add_control(
120 'title_before',
121 array(
122 'label' => __( 'Before Title', 'auxin-elements' ),
123 'type' => Controls_Manager::TEXT,
124 'default' => '',
125 'label_block' => true
126 )
127 );
128
129 $this->add_control(
130 'title_before_tag',
131 array(
132 'label' => __( 'Before Title HTML Tag', 'auxin-elements' ),
133 'type' => Controls_Manager::SELECT,
134 'options' => array(
135 'h1' => 'H1',
136 'h2' => 'H2',
137 'h3' => 'H3',
138 'h4' => 'H4',
139 'h5' => 'H5',
140 'h6' => 'H6',
141 'div' => 'Div',
142 'span' => 'Span',
143 'p' => 'P',
144 ),
145 'default' => 'span',
146 'separator' => 'after'
147 )
148 );
149
150 $this->add_control(
151 'title_after',
152 array(
153 'label' => __( 'After Title', 'auxin-elements' ),
154 'type' => Controls_Manager::TEXT,
155 'default' => '',
156 'label_block' => true
157 )
158 );
159
160 $this->add_control(
161 'title_after_tag',
162 array(
163 'label' => __( 'After Title HTML Tag', 'auxin-elements' ),
164 'type' => Controls_Manager::SELECT,
165 'options' => array(
166 'h1' => 'H1',
167 'h2' => 'H2',
168 'h3' => 'H3',
169 'h4' => 'H4',
170 'h5' => 'H5',
171 'h6' => 'H6',
172 'div' => 'Div',
173 'span' => 'Span',
174 'p' => 'P',
175 ),
176 'default' => 'span',
177 'separator' => 'after'
178 )
179 );
180
181 $this->add_responsive_control(
182 'align',
183 array(
184 'label' => __( 'Alignment', 'auxin-elements' ),
185 'type' => Controls_Manager::CHOOSE,
186 'options' => array(
187 'flex-start' => array(
188 'title' => __( 'Left', 'auxin-elements' ),
189 'icon' => 'eicon-text-align-left',
190 ),
191 'center' => array(
192 'title' => __( 'Center', 'auxin-elements' ),
193 'icon' => 'eicon-text-align-center',
194 ),
195 'flex-end' => array(
196 'title' => __( 'Right', 'auxin-elements' ),
197 'icon' => 'eicon-text-align-right',
198 ),
199 ),
200 'default' => '',
201 'selectors' => array(
202 '{{WRAPPER}}' => 'justify-content: {{VALUE}};',
203 ),
204 )
205 );
206
207 $this->end_controls_section();
208
209 $this->start_controls_section(
210 'link_section',
211 array(
212 'label' => __('Link', 'auxin-elements' ),
213 )
214 );
215
216 $this->add_control(
217 'link',
218 array(
219 'label' => __( 'Disable Link', 'auxin-elements' ),
220 'type' => Controls_Manager::SWITCHER,
221 'label_on' => __( 'On', 'auxin-elements' ),
222 'label_off' => __( 'Off', 'auxin-elements' ),
223 'return_value' => 'yes',
224 'default' => 'off',
225 )
226 );
227
228 $this->add_control(
229 'link_open',
230 array(
231 'label' => __( 'Open in a New Window', 'auxin-elements' ),
232 'type' => Controls_Manager::SWITCHER,
233 'label_on' => __( 'On', 'auxin-elements' ),
234 'label_off' => __( 'Off', 'auxin-elements' ),
235 'return_value' => 'yes',
236 'default' => 'off',
237 'condition' => array(
238 'link!' => 'yes'
239 )
240 )
241 );
242
243 $this->add_control(
244 'link_follow',
245 array(
246 'label' => __( 'Add No Follow', 'auxin-elements' ),
247 'type' => Controls_Manager::SWITCHER,
248 'label_on' => __( 'On', 'auxin-elements' ),
249 'label_off' => __( 'Off', 'auxin-elements' ),
250 'return_value' => 'yes',
251 'default' => 'off',
252 'condition' => array(
253 'link!' => 'yes'
254 )
255 )
256 );
257
258 $this->end_controls_section();
259
260 /*-----------------------------------------------------------------------------------*/
261 /* Style TAB
262
263 /*-----------------------------------------------------------------------------------*/
264 /* General Section
265 /*-------------------------------------*/
266
267 $this->start_controls_section(
268 'general_style_section',
269 array(
270 'label' => __( 'General', 'auxin-elements' ),
271 'tab' => Controls_Manager::TAB_STYLE
272 )
273 );
274
275 $this->add_control(
276 'direction',
277 array(
278 'label' => __( 'Direction', 'auxin-elements' ),
279 'type' => Controls_Manager::SELECT,
280 'options' => array(
281 'horizontal' => 'Horizontal',
282 'vertical' => 'Vertical',
283 ),
284 'default' => 'horizontal',
285 )
286 );
287
288 $this->end_controls_section();
289 /* Title Section
290 /*-------------------------------------*/
291
292 $this->start_controls_section(
293 'title_style_section',
294 array(
295 'label' => __( 'Site Title', 'auxin-elements' ),
296 'tab' => Controls_Manager::TAB_STYLE
297 )
298 );
299
300 $this->add_responsive_control(
301 'title_color',
302 array(
303 'label' => __( 'Color', 'auxin-elements' ),
304 'type' => Controls_Manager::COLOR,
305 'selectors' => array(
306 '{{WRAPPER}} .aux-site-title-heading, {{WRAPPER}} .aux-site-title-heading a' => 'color: {{VALUE}};'
307 )
308 )
309 );
310
311 $this->add_responsive_control(
312 'title_hover_color',
313 array(
314 'label' => __( 'Hover Color', 'auxin-elements' ),
315 'type' => Controls_Manager::COLOR,
316 'selectors' => array(
317 '{{WRAPPER}} .aux-site-title-heading:hover, {{WRAPPER}} .aux-site-title-heading a:hover' => 'color: {{VALUE}};',
318 ),
319 )
320 );
321
322 $this->add_group_control(
323 Group_Control_Typography::get_type(),
324 array(
325 'name' => 'title_typography',
326 'global' => [
327 'default' => Global_Typography::TYPOGRAPHY_PRIMARY,
328 ],
329 'selector' => '{{WRAPPER}} .aux-site-title-heading'
330 )
331 );
332
333 $this->add_responsive_control(
334 'title_margin',
335 array(
336 'label' => __( 'Margin', 'auxin-elements' ),
337 'type' => Controls_Manager::DIMENSIONS,
338 'size_units' => array( 'px', 'em' ),
339 'allowed_dimensions' => 'all',
340 'selectors' => array(
341 '{{WRAPPER}} .aux-site-title-heading' => 'margin:{{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};'
342 )
343 )
344 );
345
346 $this->add_group_control(
347 Group_Control_Text_Shadow::get_type(),
348 array(
349 'name' => 'title_text_shadow',
350 'label' => __( 'Text Shadow', 'auxin-elements' ),
351 'selector' => '{{WRAPPER}} .aux-site-title-heading'
352 )
353 );
354
355 $this->end_controls_section();
356
357 /* Before Title Section
358 /*-------------------------------------*/
359
360 $this->start_controls_section(
361 'before_title_style_section',
362 array(
363 'label' => __( 'Before Site Title', 'auxin-elements' ),
364 'tab' => Controls_Manager::TAB_STYLE
365 )
366 );
367
368 $this->add_responsive_control(
369 'before_title_color',
370 array(
371 'label' => __( 'Color', 'auxin-elements' ),
372 'type' => Controls_Manager::COLOR,
373 'selectors' => array(
374 '{{WRAPPER}} .aux-site-title-before-heading' => 'color: {{VALUE}};'
375 )
376 )
377 );
378
379 $this->add_responsive_control(
380 'before_title_hover_color',
381 array(
382 'label' => __( 'Hover Color', 'auxin-elements' ),
383 'type' => Controls_Manager::COLOR,
384 'selectors' => array(
385 '{{WRAPPER}} .aux-site-title-before-heading:hover' => 'color: {{VALUE}};',
386 ),
387 )
388 );
389
390 $this->add_group_control(
391 Group_Control_Typography::get_type(),
392 array(
393 'name' => 'before_title_typography',
394 'global' => [
395 'default' => Global_Typography::TYPOGRAPHY_PRIMARY,
396 ],
397 'selector' => '{{WRAPPER}} .aux-site-title-before-heading'
398 )
399 );
400
401 $this->add_responsive_control(
402 'before_title_margin',
403 array(
404 'label' => __( 'Margin', 'auxin-elements' ),
405 'type' => Controls_Manager::DIMENSIONS,
406 'size_units' => array( 'px', 'em' ),
407 'allowed_dimensions' => 'all',
408 'selectors' => array(
409 '{{WRAPPER}} .aux-site-title-before-heading' => 'margin:{{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};'
410 )
411 )
412 );
413
414 $this->add_group_control(
415 Group_Control_Text_Shadow::get_type(),
416 array(
417 'name' => 'before_title_text_shadow',
418 'label' => __( 'Text Shadow', 'auxin-elements' ),
419 'selector' => '{{WRAPPER}} .aux-site-title-before-heading'
420 )
421 );
422
423 $this->end_controls_section();
424
425 /* After Title Section
426 /*-------------------------------------*/
427
428 $this->start_controls_section(
429 'after_title_style_section',
430 array(
431 'label' => __( 'After Site Title', 'auxin-elements' ),
432 'tab' => Controls_Manager::TAB_STYLE
433 )
434 );
435
436 $this->add_responsive_control(
437 'after_title_color',
438 array(
439 'label' => __( 'Color', 'auxin-elements' ),
440 'type' => Controls_Manager::COLOR,
441 'selectors' => array(
442 '{{WRAPPER}} .aux-site-title-after-heading' => 'color: {{VALUE}};'
443 )
444 )
445 );
446
447 $this->add_responsive_control(
448 'after_title_hover_color',
449 array(
450 'label' => __( 'Hover Color', 'auxin-elements' ),
451 'type' => Controls_Manager::COLOR,
452 'selectors' => array(
453 '{{WRAPPER}} .aux-site-title-after-heading:hover' => 'color: {{VALUE}};',
454 ),
455 )
456 );
457
458 $this->add_group_control(
459 Group_Control_Typography::get_type(),
460 array(
461 'name' => 'after_title_typography',
462 'global' => [
463 'default' => Global_Typography::TYPOGRAPHY_PRIMARY,
464 ],
465 'selector' => '{{WRAPPER}} .aux-site-title-after-heading'
466 )
467 );
468
469 $this->add_responsive_control(
470 'after_title_margin',
471 array(
472 'label' => __( 'Margin', 'auxin-elements' ),
473 'type' => Controls_Manager::DIMENSIONS,
474 'size_units' => array( 'px', 'em' ),
475 'allowed_dimensions' => 'all',
476 'selectors' => array(
477 '{{WRAPPER}} .aux-site-title-after-heading' => 'margin:{{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};'
478 )
479 )
480 );
481
482 $this->add_group_control(
483 Group_Control_Text_Shadow::get_type(),
484 array(
485 'name' => 'after_title_text_shadow',
486 'label' => __( 'Text Shadow', 'auxin-elements' ),
487 'selector' => '{{WRAPPER}} .aux-site-title-after-heading'
488 )
489 );
490
491 $this->end_controls_section();
492
493 }
494
495 /**
496 * Render image box widget output on the frontend.
497 *
498 * Written in PHP and used to generate the final HTML.
499 *
500 * @since 1.0.0
501 * @access protected
502 */
503 protected function render() {
504 $settings = $this->get_settings_for_display();
505 echo sprintf( '<div class="aux-widget-site-title aux-%s">', esc_attr( $settings['direction'] ) );
506
507 $site_title = get_bloginfo('name');
508
509 if ( !auxin_is_true( $settings['link'] ) ) {
510 $site_url = home_url( '/' );
511 $no_follow = auxin_is_true( $settings['link_follow'] ) ? 'rel = ”nofollow”': '';
512 $open_window = auxin_is_true( $settings['link_open'] ) ? 'target=_blank' : '';
513 $link_output = sprintf( '<a href="%s" title="%s" %s %s>%s</a>', esc_url( $site_url ), get_bloginfo( 'name', 'display' ), $no_follow, $open_window, $site_title );
514 $site_title = $link_output;
515 }
516
517 echo $settings['title_before'] !== '' ? sprintf('<%1$s class ="aux-site-title-before-heading">%2$s</%1$s>', tag_escape( $settings['title_before_tag'] ), esc_html( $settings['title_before'] ) ) : '';
518 echo sprintf('<%1$s class="aux-site-title-heading">%2$s</%1$s>', tag_escape( $settings['title_tag'] ), wp_kses_post( $site_title ) );
519 echo $settings['title_after'] !== '' ? sprintf('<%1$s class ="aux-site-title-after-heading">%2$s</%1$s>', tag_escape( $settings['title_after_tag'] ), esc_html( $settings['title_after'] ) ) : '';
520
521 echo '</div>';
522 }
523
524 }
525