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 / logo.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
logo.php
683 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_Image_Size;
8 use Elementor\Group_Control_Typography;
9 use Elementor\Scheme_Typography;
10 use Elementor\Group_Control_Border;
11 use Elementor\Group_Control_Box_Shadow;
12 use Elementor\Group_Control_Text_Shadow;
13 use Elementor\Group_Control_Css_Filter;
14
15
16 if ( ! defined( 'ABSPATH' ) ) {
17 exit; // Exit if accessed directly.
18 }
19
20 /**
21 * Elementor 'Logo' widget.
22 *
23 * Elementor widget that displays an 'Logo'.
24 *
25 * @since 1.0.0
26 */
27 class Logo extends Widget_Base {
28
29 /**
30 * Get widget name.
31 *
32 * Retrieve 'Logo' widget name.
33 *
34 * @since 1.0.0
35 * @access public
36 *
37 * @return string Widget name.
38 */
39 public function get_name() {
40 return 'aux_logo';
41 }
42
43 /**
44 * Get widget title.
45 *
46 * Retrieve 'Logo' widget title.
47 *
48 * @since 1.0.0
49 * @access public
50 *
51 * @return string Widget title.
52 */
53 public function get_title() {
54 return __('Logo', 'auxin-elements' );
55 }
56
57 /**
58 * Get widget icon.
59 *
60 * Retrieve 'Logo' widget icon.
61 *
62 * @since 1.0.0
63 * @access public
64 *
65 * @return string Widget icon.
66 */
67 public function get_icon() {
68 return 'eicon-date auxin-badge';
69 }
70
71 /**
72 * Get widget categories.
73 *
74 * Retrieve 'Logo' widget icon.
75 *
76 * @since 1.0.0
77 * @access public
78 *
79 * @return string Widget icon.
80 */
81 public function get_categories() {
82 return array( 'auxin-core', 'auxin-theme-elements' );
83 }
84
85 /**
86 * Register 'Logo' widget controls.
87 *
88 * Adds different input fields to allow the user to change and customize the widget settings.
89 *
90 * @since 1.0.0
91 * @access protected
92 */
93 protected function _register_controls() {
94
95 /*-----------------------------------------------------------------------------------*/
96 /* button_section
97 /*-----------------------------------------------------------------------------------*/
98
99 $this->start_controls_section(
100 'general',
101 array(
102 'label' => __('General', 'auxin-elements' ),
103 )
104 );
105
106 $custom_logo_id = get_theme_mod( 'custom_logo' );
107
108
109 if ( empty( $custom_logo_id ) ) {
110 $this->add_control(
111 'custom_logo_page',
112 array(
113 'type' => Controls_Manager::RAW_HTML,
114 'raw' => sprintf( __( '<strong>There are no logo in your site.</strong><br>Go to the <a href="%s" target="_blank">Customizer</a> to add one.', 'auxin-elements' ), admin_url( 'customize.php' ) ),
115 'separator' => 'after',
116 'content_classes' => 'elementor-panel-alert elementor-panel-alert-info',
117 )
118 );
119 } else {
120 $this->add_control(
121 'custom_logo_page',
122 array(
123 'type'=> Controls_Manager::RAW_HTML,
124 'raw' => '<strong>'. __( 'Your site logo is set in customizer.', 'auxin-elements' ). '</strong><br>'.
125 sprintf( __( 'Go to %s Customizer %s to change it.', 'auxin-elements' ), '<a href="'. admin_url( 'customize.php' ) .' target="_blank">', "</a>" ),
126 'separator' => 'after',
127 'content_classes' => 'elementor-panel-alert elementor-panel-alert-info',
128 )
129 );
130 }
131
132 $this->add_control(
133 'logo_type',
134 array(
135 'label' => __( 'Type', 'auxin-elements' ),
136 'type' => Controls_Manager::SELECT,
137 'default' => 'primary',
138 'options' => array(
139 'primary' => __( 'Primary', 'auxin-elements' ),
140 'secondary' => __( 'Secondary', 'auxin-elements' ),
141 ),
142 )
143 );
144
145 $this->add_group_control(
146 Group_Control_Image_Size::get_type(),
147 array(
148 'name' => 'image', // Usage: `{name}_size` and `{name}_custom_dimension`, in this case `image_size` and `image_custom_dimension`.
149 'default' => 'full',
150 'separator' => 'none',
151 )
152 );
153
154 $this->add_responsive_control(
155 'align',
156 array(
157 'label' => __( 'Alignment', 'auxin-elements' ),
158 'type' => Controls_Manager::CHOOSE,
159 'options' => array(
160 'left' => array(
161 'title' => __( 'Left', 'auxin-elements' ),
162 'icon' => 'eicon-text-align-left',
163 ),
164 'center' => array(
165 'title' => __( 'Center', 'auxin-elements' ),
166 'icon' => 'eicon-text-align-center',
167 ),
168 'right' => array(
169 'title' => __( 'Right', 'auxin-elements' ),
170 'icon' => 'eicon-text-align-right',
171 ),
172 ),
173 'selectors' => array(
174 '{{WRAPPER}}' => 'text-align: {{VALUE}};',
175 ),
176 )
177 );
178
179 $this->add_control(
180 'link_to',
181 array(
182 'label' => __( 'Link', 'auxin-elements' ),
183 'type' => Controls_Manager::SELECT,
184 'default' => 'home',
185 'options' => array(
186 'home' => __( 'Home Page', 'auxin-elements' ),
187 'file' => __( 'Media File', 'auxin-elements' ),
188 'custom' => __( 'Custom URL', 'auxin-elements' ),
189 ),
190 )
191 );
192
193 $this->add_control(
194 'link',
195 array(
196 'label' => __( 'Link', 'auxin-elements' ),
197 'type' => Controls_Manager::URL,
198 'placeholder' => __( 'https://your-link.com', 'auxin-elements' ),
199 'dynamic' => [
200 'active' => true
201 ],
202 'condition' => array(
203 'link_to' => 'custom',
204 ),
205 'show_label' => false,
206 )
207 );
208
209 $this->end_controls_section();
210
211 $this->start_controls_section(
212 'section_style_image',
213 array(
214 'label' => __( 'Image', 'auxin-elements' ),
215 'tab' => Controls_Manager::TAB_STYLE,
216 )
217 );
218
219 $this->add_responsive_control(
220 'width',
221 array(
222 'label' => __( 'Width', 'auxin-elements' ),
223 'type' => Controls_Manager::SLIDER,
224 'default' => array(
225 'unit' => '%',
226 ),
227 'tablet_default' => array(
228 'unit' => '%',
229 ),
230 'mobile_default' => array(
231 'unit' => '%',
232 ),
233 'size_units' => array( '%', 'px', 'vw' ),
234 'range' => array(
235 '%' => array(
236 'min' => 1,
237 'max' => 100,
238 ),
239 'px' => array(
240 'min' => 1,
241 'max' => 1000,
242 ),
243 'vw' => array(
244 'min' => 1,
245 'max' => 100,
246 ),
247 ),
248 'selectors' => array(
249 '{{WRAPPER}} .aux-has-logo img' => 'width: {{SIZE}}{{UNIT}};',
250 ),
251 )
252 );
253
254 $this->add_responsive_control(
255 'space',
256 array(
257 'label' => __( 'Max Width', 'auxin-elements' ) . ' (%)',
258 'type' => Controls_Manager::SLIDER,
259 'default' => array(
260 'unit' => '%',
261 ),
262 'tablet_default' => array(
263 'unit' => '%',
264 ),
265 'mobile_default' => array(
266 'unit' => '%',
267 ),
268 'size_units' => array( '%' ),
269 'range' => array(
270 '%' => array(
271 'min' => 1,
272 'max' => 100,
273 ),
274 ),
275 'selectors' => array(
276 '{{WRAPPER}} .aux-has-logo img' => 'max-width: {{SIZE}}{{UNIT}};',
277 ),
278 )
279 );
280
281 $this->add_control(
282 'separator_panel_style',
283 array(
284 'type' => Controls_Manager::DIVIDER,
285 'style' => 'thick',
286 )
287 );
288
289 $this->start_controls_tabs( 'image_effects' );
290
291 $this->start_controls_tab( 'normal',
292 array(
293 'label' => __( 'Normal', 'auxin-elements' ),
294 )
295 );
296
297 $this->add_control(
298 'opacity',
299 array(
300 'label' => __( 'Opacity', 'auxin-elements' ),
301 'type' => Controls_Manager::SLIDER,
302 'range' => array(
303 'px' => array(
304 'max' => 1,
305 'min' => 0.10,
306 'step' => 0.01,
307 ),
308 ),
309 'selectors' => array(
310 '{{WRAPPER}} .aux-has-logo img' => 'opacity: {{SIZE}};',
311 ),
312 )
313 );
314
315 $this->add_group_control(
316 Group_Control_Css_Filter::get_type(),
317 array(
318 'name' => 'css_filters',
319 'selector' => '{{WRAPPER}} .aux-has-logo img',
320 )
321 );
322
323 $this->end_controls_tab();
324
325 $this->start_controls_tab( 'hover',
326 array(
327 'label' => __( 'Hover', 'auxin-elements' ),
328 )
329 );
330
331 $this->add_control(
332 'opacity_hover',
333 array(
334 'label' => __( 'Opacity', 'auxin-elements' ),
335 'type' => Controls_Manager::SLIDER,
336 'range' => array(
337 'px' => array(
338 'max' => 1,
339 'min' => 0.10,
340 'step' => 0.01,
341 ),
342 ),
343 'selectors' => array(
344 '{{WRAPPER}} .aux-has-logo:hover img' => 'opacity: {{SIZE}};',
345 ),
346 )
347 );
348
349 $this->add_group_control(
350 Group_Control_Css_Filter::get_type(),
351 array(
352 'name' => 'css_filters_hover',
353 'selector' => '{{WRAPPER}} .aux-has-logo:hover img',
354 )
355 );
356
357 $this->add_control(
358 'background_hover_transition',
359 array(
360 'label' => __( 'Transition Duration', 'auxin-elements' ),
361 'type' => Controls_Manager::SLIDER,
362 'range' => array(
363 'px' => array(
364 'max' => 3,
365 'step' => 0.1,
366 ),
367 ),
368 'selectors' => array(
369 '{{WRAPPER}} .aux-has-logo img' => 'transition-duration: {{SIZE}}s',
370 ),
371 )
372 );
373
374 $this->end_controls_tab();
375
376 $this->end_controls_tabs();
377
378 $this->add_group_control(
379 Group_Control_Border::get_type(),
380 array(
381 'name' => 'image_border',
382 'selector' => '{{WRAPPER}} .aux-has-logo img',
383 'separator' => 'before',
384 )
385 );
386
387 $this->add_responsive_control(
388 'image_border_radius',
389 array(
390 'label' => __( 'Border Radius', 'auxin-elements' ),
391 'type' => Controls_Manager::DIMENSIONS,
392 'size_units' => array( 'px', '%' ),
393 'selectors' => array(
394 '{{WRAPPER}} .aux-has-logo img' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
395 ),
396 )
397 );
398
399 $this->add_group_control(
400 Group_Control_Box_Shadow::get_type(),
401 array(
402 'name' => 'image_box_shadow',
403 'exclude' => array(
404 'box_shadow_position',
405 ),
406 'selector' => '{{WRAPPER}} .aux-has-logo img',
407 )
408 );
409
410 $this->end_controls_section();
411
412 $this->start_controls_section(
413 'section_style_title',
414 array(
415 'label' => __( 'Title', 'auxin-elements' ),
416 'tab' => Controls_Manager::TAB_STYLE,
417 )
418 );
419
420 $this->add_responsive_control(
421 'title_color',
422 array(
423 'label' => __( 'Color', 'auxin-elements' ),
424 'type' => Controls_Manager::COLOR,
425 'selectors' => array(
426 '{{WRAPPER}} .site-title a, {{WRAPPER}} .site-title' => 'color: {{VALUE}};'
427 )
428 )
429 );
430
431 $this->add_responsive_control(
432 'title_hover_color',
433 array(
434 'label' => __( 'Hover Color', 'auxin-elements' ),
435 'type' => Controls_Manager::COLOR,
436 'selectors' => array(
437 '{{WRAPPER}} .site-title a:hover, {{WRAPPER}} .site-title:hover' => 'color: {{VALUE}};',
438 ),
439 )
440 );
441
442 $this->add_group_control(
443 Group_Control_Typography::get_type(),
444 array(
445 'name' => 'title_typography',
446 'scheme' => Scheme_Typography::TYPOGRAPHY_1,
447 'selector' => '{{WRAPPER}} .site-title a'
448 )
449 );
450
451 $this->add_responsive_control(
452 'title_margin',
453 array(
454 'label' => __( 'Margin', 'auxin-elements' ),
455 'type' => Controls_Manager::DIMENSIONS,
456 'size_units' => array( 'px', 'em' ),
457 'allowed_dimensions' => 'all',
458 'selectors' => array(
459 '{{WRAPPER}} .site-title' => 'margin:{{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};'
460 )
461 )
462 );
463
464 $this->add_group_control(
465 Group_Control_Text_Shadow::get_type(),
466 array(
467 'name' => 'title_text_shadow',
468 'label' => __( 'Text Shadow', 'auxin-elements' ),
469 'selector' => '{{WRAPPER}} .site-title a'
470 )
471 );
472
473 $this->add_responsive_control(
474 'title_width',
475 array(
476 'label' => __('Max Width','auxin-elements' ),
477 'type' => Controls_Manager::SLIDER,
478 'size_units' => array('px', 'em','%'),
479 'range' => array(
480 '%' => array(
481 'min' => 1,
482 'max' => 100,
483 'step' => 1
484 ),
485 'em' => array(
486 'min' => 1,
487 'max' => 100,
488 'step' => 1
489 ),
490 'px' => array(
491 'min' => 1,
492 'max' => 1600,
493 'step' => 1
494 )
495 ),
496 'selectors' => array(
497 '{{WRAPPER}} .site-title' => 'max-width:{{SIZE}}{{UNIT}};'
498 )
499 )
500 );
501
502 $this->end_controls_section();
503
504 $this->start_controls_section(
505 'section_style_desc',
506 array(
507 'label' => __( 'Description', 'auxin-elements' ),
508 'tab' => Controls_Manager::TAB_STYLE,
509 )
510 );
511
512 $this->add_responsive_control(
513 'desc_color',
514 array(
515 'label' => __( 'Color', 'auxin-elements' ),
516 'type' => Controls_Manager::COLOR,
517 'selectors' => array(
518 '{{WRAPPER}} .site-description' => 'color: {{VALUE}};'
519 )
520 )
521 );
522
523 $this->add_responsive_control(
524 'desc_hover_color',
525 array(
526 'label' => __( 'Hover Color', 'auxin-elements' ),
527 'type' => Controls_Manager::COLOR,
528 'selectors' => array(
529 '{{WRAPPER}} .site-description:hover' => 'color: {{VALUE}};',
530 ),
531 )
532 );
533
534 $this->add_group_control(
535 Group_Control_Typography::get_type(),
536 array(
537 'name' => 'desc_typography',
538 'scheme' => Scheme_Typography::TYPOGRAPHY_1,
539 'selector' => '{{WRAPPER}} .site-description'
540 )
541 );
542
543 $this->add_responsive_control(
544 'desc_margin',
545 array(
546 'label' => __( 'Margin', 'auxin-elements' ),
547 'type' => Controls_Manager::DIMENSIONS,
548 'size_units' => array( 'px', 'em' ),
549 'allowed_dimensions' => 'all',
550 'selectors' => array(
551 '{{WRAPPER}} .site-description' => 'margin:{{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};'
552 )
553 )
554 );
555
556 $this->add_group_control(
557 Group_Control_Text_Shadow::get_type(),
558 array(
559 'name' => 'desc_text_shadow',
560 'label' => __( 'Text Shadow', 'auxin-elements' ),
561 'selector' => '{{WRAPPER}} .site-description'
562 )
563 );
564
565 $this->add_responsive_control(
566 'desc_width',
567 array(
568 'label' => __('Max Width','auxin-elements' ),
569 'type' => Controls_Manager::SLIDER,
570 'size_units' => array('px', 'em','%'),
571 'range' => array(
572 '%' => array(
573 'min' => 1,
574 'max' => 100,
575 'step' => 1
576 ),
577 'em' => array(
578 'min' => 1,
579 'max' => 100,
580 'step' => 1
581 ),
582 'px' => array(
583 'min' => 1,
584 'max' => 1600,
585 'step' => 1
586 )
587 ),
588 'selectors' => array(
589 '{{WRAPPER}} .site-description' => 'max-width:{{SIZE}}{{UNIT}};'
590 )
591 )
592 );
593
594 $this->end_controls_section();
595
596 }
597
598 /**
599 * Render image box widget output on the frontend.
600 *
601 * Written in PHP and used to generate the final HTML.
602 *
603 * @since 1.0.0
604 * @access protected
605 */
606 protected function render() {
607
608 $settings = $this->get_settings_for_display();
609 $logo_desc = get_bloginfo( 'description' );
610 $custom_logo_id = get_theme_mod( 'custom_logo' );
611 $secondary_logo_id = auxin_get_option('custom_logo2');
612 $blog_display_name = get_bloginfo( 'name', 'display' );
613 $blog_name = get_bloginfo( 'name' );
614 $home_url = home_url( '/' );
615 $link_attr = array(
616 'class' => 'aux-logo-anchor aux-has-logo',
617 'title' => esc_attr( $blog_display_name )
618 );
619 $logo_markup = '';
620 $output = '';
621
622
623 if ( 'home' === $settings['link_to'] ) {
624 $link_attr['href'] = esc_url ( $home_url );
625 } else if ( 'file' === $settings['link_to'] ) {
626 $link_attr['href'] = esc_url ( wp_get_attachment_url( $custom_logo_id ) ) ;
627 } else {
628 $link_attr['href'] = esc_url ( $settings['link']['url'] ) ;
629
630 if ( auxin_is_true( $settings['link']['is_external'] ) ) {
631 $link_attr['target'] = '_blank';
632 }
633
634 if ( auxin_is_true( $settings['link']['nofollow'] ) ) {
635 $link_attr['rel'] = 'nofollow';
636 }
637 }
638
639 $link_attr = auxin_make_html_attributes( $link_attr );
640
641 if ( $custom_logo_id ) {
642
643 $logo_image_markup = '';
644 $logo_id = 'primary' === $settings['logo_type'] ? $custom_logo_id : $secondary_logo_id;
645
646 if ( $settings['image_custom_dimension'] ) {
647 $image_size = $settings['image_custom_dimension'];
648 } else {
649 $image_size = $settings['image_size'];
650 }
651
652 $logo_image_markup = auxin_get_the_responsive_attachment( $logo_id,
653 array(
654 'quality' => 100,
655 'size' => $image_size,
656 'crop' => true,
657 'add_hw' => true,
658 'upscale' => false,
659 'preloadable' => false
660 )
661 );
662
663 $logo_markup = '<a ' . $link_attr . ' >' . $logo_image_markup . '</a>';
664 }
665
666 $output .= '<div class="aux-widget-logo">';
667 $output .= $logo_markup;
668 $output .= '<section class="aux-logo-text">';
669 $output .= '<h3 class="site-title">';
670 $output .= '<a href="' . esc_url( $home_url ) . '" title="' . esc_attr( $blog_display_name ) . '">';
671 $output .= $blog_name;
672 $output .= '</a>';
673 $output .= '</h3>';
674 $output .= $logo_desc ? '<p class="site-description">' . $logo_desc . '</p>' : '';
675 $output .= '</section>';
676 $output .= '</div>';
677
678 echo $output;
679
680 }
681
682 }
683