PluginProbe ʕ •ᴥ•ʔ
Shortcodes and extra features for Phlox theme / 2.5.8
Shortcodes and extra features for Phlox theme v2.5.8
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 6 years ago copyright.php 6 years ago current-time.php 6 years ago logo.php 6 years ago menu.php 6 years ago modern-search.php 6 years ago search.php 6 years ago shopping-cart.php 6 years ago site-title.php 6 years 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\Scheme_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' => 'fa fa-align-left',
190 ),
191 'center' => array(
192 'title' => __( 'Center', 'auxin-elements' ),
193 'icon' => 'fa fa-align-center',
194 ),
195 'flex-end' => array(
196 'title' => __( 'Right', 'auxin-elements' ),
197 'icon' => 'fa fa-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 'scheme' => Scheme_Typography::TYPOGRAPHY_1,
327 'selector' => '{{WRAPPER}} .aux-site-title-heading'
328 )
329 );
330
331 $this->add_responsive_control(
332 'title_margin',
333 array(
334 'label' => __( 'Margin', 'auxin-elements' ),
335 'type' => Controls_Manager::DIMENSIONS,
336 'size_units' => array( 'px', 'em' ),
337 'allowed_dimensions' => 'all',
338 'selectors' => array(
339 '{{WRAPPER}} .aux-site-title-heading' => 'margin:{{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};'
340 )
341 )
342 );
343
344 $this->add_group_control(
345 Group_Control_Text_Shadow::get_type(),
346 array(
347 'name' => 'title_text_shadow',
348 'label' => __( 'Text Shadow', 'auxin-elements' ),
349 'selector' => '{{WRAPPER}} .aux-site-title-heading'
350 )
351 );
352
353 $this->end_controls_section();
354
355 /* Before Title Section
356 /*-------------------------------------*/
357
358 $this->start_controls_section(
359 'before_title_style_section',
360 array(
361 'label' => __( 'Before Site Title', 'auxin-elements' ),
362 'tab' => Controls_Manager::TAB_STYLE
363 )
364 );
365
366 $this->add_responsive_control(
367 'before_title_color',
368 array(
369 'label' => __( 'Color', 'auxin-elements' ),
370 'type' => Controls_Manager::COLOR,
371 'selectors' => array(
372 '{{WRAPPER}} .aux-site-title-before-heading' => 'color: {{VALUE}};'
373 )
374 )
375 );
376
377 $this->add_responsive_control(
378 'before_title_hover_color',
379 array(
380 'label' => __( 'Hover Color', 'auxin-elements' ),
381 'type' => Controls_Manager::COLOR,
382 'selectors' => array(
383 '{{WRAPPER}} .aux-site-title-before-heading:hover' => 'color: {{VALUE}};',
384 ),
385 )
386 );
387
388 $this->add_group_control(
389 Group_Control_Typography::get_type(),
390 array(
391 'name' => 'before_title_typography',
392 'scheme' => Scheme_Typography::TYPOGRAPHY_1,
393 'selector' => '{{WRAPPER}} .aux-site-title-before-heading'
394 )
395 );
396
397 $this->add_responsive_control(
398 'before_title_margin',
399 array(
400 'label' => __( 'Margin', 'auxin-elements' ),
401 'type' => Controls_Manager::DIMENSIONS,
402 'size_units' => array( 'px', 'em' ),
403 'allowed_dimensions' => 'all',
404 'selectors' => array(
405 '{{WRAPPER}} .aux-site-title-before-heading' => 'margin:{{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};'
406 )
407 )
408 );
409
410 $this->add_group_control(
411 Group_Control_Text_Shadow::get_type(),
412 array(
413 'name' => 'before_title_text_shadow',
414 'label' => __( 'Text Shadow', 'auxin-elements' ),
415 'selector' => '{{WRAPPER}} .aux-site-title-before-heading'
416 )
417 );
418
419 $this->end_controls_section();
420
421 /* After Title Section
422 /*-------------------------------------*/
423
424 $this->start_controls_section(
425 'after_title_style_section',
426 array(
427 'label' => __( 'After Site Title', 'auxin-elements' ),
428 'tab' => Controls_Manager::TAB_STYLE
429 )
430 );
431
432 $this->add_responsive_control(
433 'after_title_color',
434 array(
435 'label' => __( 'Color', 'auxin-elements' ),
436 'type' => Controls_Manager::COLOR,
437 'selectors' => array(
438 '{{WRAPPER}} .aux-site-title-after-heading' => 'color: {{VALUE}};'
439 )
440 )
441 );
442
443 $this->add_responsive_control(
444 'after_title_hover_color',
445 array(
446 'label' => __( 'Hover Color', 'auxin-elements' ),
447 'type' => Controls_Manager::COLOR,
448 'selectors' => array(
449 '{{WRAPPER}} .aux-site-title-after-heading:hover' => 'color: {{VALUE}};',
450 ),
451 )
452 );
453
454 $this->add_group_control(
455 Group_Control_Typography::get_type(),
456 array(
457 'name' => 'after_title_typography',
458 'scheme' => Scheme_Typography::TYPOGRAPHY_1,
459 'selector' => '{{WRAPPER}} .aux-site-title-after-heading'
460 )
461 );
462
463 $this->add_responsive_control(
464 'after_title_margin',
465 array(
466 'label' => __( 'Margin', 'auxin-elements' ),
467 'type' => Controls_Manager::DIMENSIONS,
468 'size_units' => array( 'px', 'em' ),
469 'allowed_dimensions' => 'all',
470 'selectors' => array(
471 '{{WRAPPER}} .aux-site-title-after-heading' => 'margin:{{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};'
472 )
473 )
474 );
475
476 $this->add_group_control(
477 Group_Control_Text_Shadow::get_type(),
478 array(
479 'name' => 'after_title_text_shadow',
480 'label' => __( 'Text Shadow', 'auxin-elements' ),
481 'selector' => '{{WRAPPER}} .aux-site-title-after-heading'
482 )
483 );
484
485 $this->end_controls_section();
486
487 }
488
489 /**
490 * Render image box widget output on the frontend.
491 *
492 * Written in PHP and used to generate the final HTML.
493 *
494 * @since 1.0.0
495 * @access protected
496 */
497 protected function render() {
498 $settings = $this->get_settings_for_display();
499 $output = sprintf( '<div class="aux-widget-site-title aux-%s">', $settings['direction'] );
500
501 $site_title = get_bloginfo('name');
502
503 if ( !auxin_is_true( $settings['link'] ) ) {
504 $site_url = home_url( '/' );
505 $no_follow = auxin_is_true( $settings['link_follow'] ) ? 'rel = ”nofollow”': '';
506 $open_window = auxin_is_true( $settings['link_open'] ) ? 'target=_blank' : '';
507 $link_output = sprintf( '<a href="%s" title="%s" %s %s>%s</a>', $site_url, get_bloginfo( 'name', 'display' ), $no_follow, $open_window, $site_title );
508 $site_title = $link_output;
509 }
510
511 $before_site_title_output = $settings['title_before'] !== '' ? sprintf('<%1$s class ="aux-site-title-before-heading">%2$s</%1$s>', $settings['title_before_tag'], $settings['title_before'] ) : '';
512 $after_site_title_output = $settings['title_after'] !== '' ? sprintf('<%1$s class ="aux-site-title-after-heading">%2$s</%1$s>', $settings['title_after_tag'], $settings['title_after'] ) : '';
513 $site_title_output = sprintf('<%1$s class="aux-site-title-heading">%2$s</%1$s>', $settings['title_tag'], $site_title );
514
515 $output .= $before_site_title_output;
516 $output .= $site_title_output;
517 $output .= $after_site_title_output;
518
519 $output .= '</div>';
520
521 echo $output;
522 }
523
524 }
525