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 / breadcrumbs.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
breadcrumbs.php
586 lines
1 <?php
2 namespace Auxin\Plugin\CoreElements\Elementor\Elements\Theme_Elements;
3
4 use Elementor\Widget_Base;
5 use Elementor\Controls_Manager;
6 use Elementor\Group_Control_Typography;
7 use Elementor\Scheme_Color;
8 use Elementor\Scheme_Typography;
9 use Elementor\Group_Control_Border;
10 use Elementor\Group_Control_Background;
11 use Elementor\Group_Control_Box_Shadow;
12 use Elementor\Group_Control_Text_Shadow;
13
14
15 if ( ! defined( 'ABSPATH' ) ) {
16 exit; // Exit if accessed directly.
17 }
18
19 /**
20 * Elementor 'Breadcrumbs' widget.
21 *
22 * Elementor widget that displays an 'PostTitle'.
23 *
24 * @since 1.0.0
25 */
26 class Breadcrumbs extends Widget_Base {
27
28 /**
29 * Get widget name.
30 *
31 * Retrieve 'Breadcrumbs' widget name.
32 *
33 * @since 1.0.0
34 * @access public
35 *
36 * @return string Widget name.
37 */
38 public function get_name() {
39 return 'aux_breadcrumbs';
40 }
41
42 /**
43 * Get widget title.
44 *
45 * Retrieve 'Breadcrumbs' widget title.
46 *
47 * @since 1.0.0
48 * @access public
49 *
50 * @return string Widget title.
51 */
52 public function get_title() {
53 return __( 'Breadcrumbs', 'auxin-elements' );
54 }
55
56 /**
57 * Get widget icon.
58 *
59 * Retrieve 'Breadcrumbs' widget icon.
60 *
61 * @since 1.0.0
62 * @access public
63 *
64 * @return string Widget icon.
65 */
66 public function get_icon() {
67 return 'eicon-product-breadcrumbs auxin-badge';
68 }
69
70 /**
71 * Get widget categories.
72 *
73 * Retrieve 'Breadcrumbs' widget icon.
74 *
75 * @since 1.0.0
76 * @access public
77 *
78 * @return string Widget icon.
79 */
80 public function get_categories() {
81 return array( 'auxin-core', 'auxin-theme-elements-single' );
82 }
83
84
85 private function is_yoast_breadcrumbs_enabled(){
86
87 $is_enabled = false;
88
89 if ( function_exists( 'yoast_breadcrumb' ) ) {
90 if ( ! $is_enabled = current_theme_supports( 'yoast-seo-breadcrumbs' ) ) {
91 $options = get_option( 'wpseo_titles' );
92 $is_enabled = isset( $options['breadcrumbs-enable'] ) && ( $options['breadcrumbs-enable'] === true );
93 }
94 }
95
96 return $is_enabled;
97 }
98
99 /**
100 * Register 'Breadcrumbs' widget controls.
101 *
102 * Adds different input fields to allow the user to change and customize the widget settings.
103 *
104 * @since 1.0.0
105 * @access protected
106 */
107 protected function _register_controls() {
108
109 /*--------------------------------------------------------------------*/
110 /* Content
111 /*--------------------------------------------------------------------*/
112
113 $this->start_controls_section(
114 'section_breadcrumb',
115 [
116 'label' => __( 'General', 'auxin-elements' ),
117 ]
118 );
119
120 if ( ! $yoast_breadcrumbs_enabled = $this->is_yoast_breadcrumbs_enabled() ) {
121
122 $this->add_control(
123 'show_home_icon',
124 array(
125 'label' => __('Show home icon','auxin-elements' ),
126 'description' => __('Show icon instead of text for home', 'auxin-elements' ),
127 'type' => Controls_Manager::SWITCHER,
128 'label_on' => __( 'On', 'auxin-elements' ),
129 'label_off' => __( 'Off', 'auxin-elements' ),
130 'return_value' => 'yes',
131 'default' => ''
132 )
133 );
134
135 $this->add_control(
136 'home_icon',
137 [
138 'label' => __( 'Custom Seperator Icon', 'auxin-elements' ),
139 'label_block' => true,
140 'type' => Controls_Manager::ICONS,
141 'recommended' => [
142 'fa-solid' => [
143 'home'
144 ],
145 'auxicon' =>[
146 'home-house-streamline',
147 'home',
148 'home-1',
149 'home-2',
150 'home-3'
151 ]
152 ],
153 'exclude_inline_options' => [ 'svg' ],
154 'default' => [
155 'value' => 'auxicon-home-house-streamline',
156 'library' => 'auxicon'
157 ],
158 'condition' => [
159 'show_home_icon' => 'yes'
160 ]
161 ]
162 );
163
164 $this->add_control(
165 'separator_icon',
166 [
167 'label' => __( 'Custom Separator', 'auxin-elements' ),
168 'label_block' => true,
169 'type' => Controls_Manager::ICONS,
170 'recommended' => [
171 'auxicon2' => [
172 "arrows-right-double-chevron",
173 "arrows-chevron-thin-right",
174 "arrow-slim-right-dashed",
175 "arrow-slim-right",
176 "arrow-chevron-med-right",
177 "arrow-chevron-fat-right",
178 "arrow-chevron-slim-right",
179 "arrow-chevron-pixel-right",
180 "arrow-line-med-right",
181 "arrow-line-right",
182 "arrow-chevron-pixel-right2",
183 "arrow-pixel-fat-right",
184 "arrow-thin-right",
185 "arrow-chevron-small-right",
186 "arrow-circle-right"
187 ]
188 ],
189 'separator' => 'before'
190 ]
191 );
192
193 } else {
194 $this->add_control(
195 'yoast_is_enabled_notice',
196 [
197 'type' => Controls_Manager::RAW_HTML,
198 'raw' => __( 'Note: Breadcrumb is using "Yoast SEO" plugin. You can change the options from plugin setting page.', 'auxin-elements' ),
199 'content_classes' => 'elementor-panel-alert elementor-panel-alert-danger',
200 ]
201 );
202 }
203
204 $this->end_controls_section();
205
206
207 /*----------------------------------------------------------------*/
208 /* Style
209 /*----------------------------------------------------------------*/
210
211 if ( ! $yoast_breadcrumbs_enabled ) {
212
213 $this->start_controls_section(
214 'home_icon_style_section',
215 [
216 'label' => __( 'Home Icon', 'auxin-elements' ),
217 'tab' => Controls_Manager::TAB_STYLE,
218 'condition' => [
219 'show_home_icon' => 'yes'
220 ]
221 ]
222 );
223
224 $this->add_responsive_control(
225 'home_icon_position',
226 [
227 'label' => __( 'Position', 'auxin-elements' ),
228 'type' => Controls_Manager::DIMENSIONS,
229 'allowed_dimensions' => 'vertical',
230 'size_units' => [ 'px', '%', 'em' ],
231 'selectors' => [
232 '{{WRAPPER}} .aux-breadcrumb-home' => 'position:relative; top: {{TOP}}{{UNIT}}; bottom:{{BOTTOM}}{{UNIT}};'
233 ]
234 ]
235 );
236
237 $this->add_responsive_control(
238 'home_icon_margin',
239 [
240 'label' => __( 'Margin', 'auxin-elements' ),
241 'type' => Controls_Manager::DIMENSIONS,
242 'allowed_dimensions' => 'horizontal',
243 'size_units' => [ 'px', '%', 'em' ],
244 'selectors' => [
245 '{{WRAPPER}} .aux-breadcrumb-home' => 'margin: auto {{RIGHT}}{{UNIT}} auto {{LEFT}}{{UNIT}};'
246 ]
247 ]
248 );
249
250 $this->add_control(
251 'home_icon_color',
252 [
253 'label' => __( 'Icon Color', 'auxin-elements' ),
254 'type' => Controls_Manager::COLOR,
255 'scheme' => [
256 'type' => Scheme_Color::get_type(),
257 'value' => Scheme_Color::COLOR_1,
258 ],
259 'selectors' => [
260 '{{WRAPPER}} span.aux-breadcrumb-home' => 'color: {{VALUE}};',
261 ]
262 ]
263 );
264
265 $this->add_responsive_control(
266 'home_icon_size',
267 [
268 'label' => __( 'Size', 'auxin-elements' ),
269 'type' => Controls_Manager::SLIDER,
270 'size_units' => [ 'px', '%', 'em' ],
271 'selectors' => [
272 '{{WRAPPER}} .aux-breadcrumb-home' => 'font-size:{{SIZE}}{{UNIT}};'
273 ]
274 ]
275 );
276
277 $this->end_controls_section();
278 }
279
280 /*--------------------------------------------------------------------*/
281 /* Text style
282 /*--------------------------------------------------------------------*/
283
284 $this->start_controls_section(
285 'text_style_section',
286 [
287 'label' => __( 'Text', 'auxin-elements' ),
288 'tab' => Controls_Manager::TAB_STYLE,
289 ]
290 );
291
292 $this->add_control(
293 'link_color',
294 [
295 'label' => __( 'Link Color', 'auxin-elements' ),
296 'type' => Controls_Manager::COLOR,
297 'scheme' => [
298 'type' => Scheme_Color::get_type(),
299 'value' => Scheme_Color::COLOR_1,
300 ],
301 'selectors' => [
302 '{{WRAPPER}} span:not(.aux-breadcrumb-sep) a' => 'color: {{VALUE}};',
303 ],
304 ]
305 );
306
307 $this->add_control(
308 'link_hover_color',
309 [
310 'label' => __( 'Link Hover Color', 'auxin-elements' ),
311 'type' => Controls_Manager::COLOR,
312 'scheme' => [
313 'type' => Scheme_Color::get_type(),
314 'value' => Scheme_Color::COLOR_1,
315 ],
316 'selectors' => [
317 '{{WRAPPER}} span:not(.aux-breadcrumb-sep) a:hover' => 'color: {{VALUE}};',
318 ],
319 ]
320 );
321
322 $this->add_control(
323 'text_color',
324 [
325 'label' => __( 'Text Color', 'auxin-elements' ),
326 'type' => Controls_Manager::COLOR,
327 'scheme' => [
328 'type' => Scheme_Color::get_type(),
329 'value' => Scheme_Color::COLOR_1,
330 ],
331 'selectors' => [
332 '{{WRAPPER}} span:not(.aux-breadcrumb-sep)' => 'color: {{VALUE}};',
333 ],
334 ]
335 );
336
337 $this->add_group_control(
338 Group_Control_Typography::get_type(),
339 [
340 'name' => 'typography',
341 'scheme' => Scheme_Typography::TYPOGRAPHY_1,
342 'selector' => '{{WRAPPER}} span'
343 ]
344 );
345
346 $this->add_group_control(
347 Group_Control_Text_Shadow::get_type(),
348 [
349 'name' => 'text_shadow',
350 'selector' => '{{WRAPPER}} span'
351 ]
352 );
353
354 $this->end_controls_section();
355
356 /*--------------------------------------------------------------------*/
357 /* Separator
358 /*--------------------------------------------------------------------*/
359
360 if ( ! $yoast_breadcrumbs_enabled ) {
361
362 $this->start_controls_section(
363 'separator_style_section',
364 [
365 'label' => __( 'Separator', 'auxin-elements' ),
366 'tab' => Controls_Manager::TAB_STYLE,
367 ]
368 );
369
370 $this->add_responsive_control(
371 'separator_margin',
372 [
373 'label' => __( 'Margin', 'auxin-elements' ),
374 'type' => Controls_Manager::DIMENSIONS,
375 'size_units' => [ 'px', '%', 'em' ],
376 'selectors' => [
377 '{{WRAPPER}} .aux-breadcrumb-sep' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};'
378 ]
379 ]
380 );
381
382 $this->add_control(
383 'separator_icon_color',
384 [
385 'label' => __( 'Icon Color', 'auxin-elements' ),
386 'type' => Controls_Manager::COLOR,
387 'scheme' => [
388 'type' => Scheme_Color::get_type(),
389 'value' => Scheme_Color::COLOR_1,
390 ],
391 'selectors' => [
392 '{{WRAPPER}} span.aux-breadcrumb-sep' => 'color: {{VALUE}};',
393 ]
394 ]
395 );
396
397 $this->add_responsive_control(
398 'separator_size',
399 [
400 'label' => __( 'Size', 'auxin-elements' ),
401 'type' => Controls_Manager::SLIDER,
402 'size_units' => [ 'px', '%', 'em' ],
403 'selectors' => [
404 '{{WRAPPER}} .aux-breadcrumb-sep' => 'font-size:{{SIZE}}{{UNIT}};'
405 ]
406 ]
407 );
408
409 $this->end_controls_section();
410 }
411
412 /*--------------------------------------------------------------------*/
413 /* Container
414 /*--------------------------------------------------------------------*/
415
416 $this->start_controls_section(
417 'container_style_section',
418 [
419 'label' => __( 'Container', 'auxin-elements' ),
420 'tab' => Controls_Manager::TAB_STYLE,
421 ]
422 );
423
424 $this->add_responsive_control(
425 'container_alignment',
426 [
427 'label' => __('Alignment','auxin-elements' ),
428 'type' => Controls_Manager::CHOOSE,
429 'options' => [
430 'left' => [
431 'title' => __( 'Left', 'auxin-elements' ),
432 'icon' => 'fa fa-align-left'
433 ],
434 'center' => [
435 'title' => __( 'Center', 'auxin-elements' ),
436 'icon' => 'fa fa-align-center'
437 ],
438 'right' => [
439 'title' => __( 'Right', 'auxin-elements' ),
440 'icon' => 'fa fa-align-right'
441 ]
442 ],
443 'default' => '',
444 'separator' => 'after',
445 'toggle' => true,
446 'selectors' => [
447 '{{WRAPPER}} .aux-elementor-breadcrumbs' => 'text-align:{{VALUE}};'
448 ]
449 ]
450 );
451
452 $this->add_group_control(
453 Group_Control_Border::get_type(),
454 [
455 'name' => 'container_border',
456 'selector' => '{{WRAPPER}} .aux-breadcrumbs'
457 ]
458 );
459
460 $this->add_responsive_control(
461 'container_border_radius',
462 [
463 'label' => __( 'Border Radius', 'auxin-elements' ),
464 'type' => Controls_Manager::DIMENSIONS,
465 'size_units' => [ 'px', '%' ],
466 'selectors' => [
467 '{{WRAPPER}} p.aux-breadcrumbs' => 'border-radius:{{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};'
468 ]
469 ]
470 );
471
472 $this->add_responsive_control(
473 'container_padding',
474 [
475 'label' => __( 'Padding', 'auxin-elements' ),
476 'type' => Controls_Manager::DIMENSIONS,
477 'size_units' => [ 'px', '%', 'em' ],
478 'selectors' => [
479 '{{WRAPPER}} p.aux-breadcrumbs' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};'
480 ],
481 'separator' => 'after'
482 ]
483 );
484
485 $this->start_controls_tabs( 'container_style_tabs' );
486
487 $this->start_controls_tab(
488 'container_tab_normal_state',
489 [
490 'label' => __( 'Normal', 'auxin-elements' ),
491 ]
492 );
493
494 $this->add_group_control(
495 Group_Control_Background::get_type(),
496 [
497 'name' => 'container_background',
498 'selector' => '{{WRAPPER}} p.aux-breadcrumbs',
499 'types' => [ 'classic', 'gradient']
500 ]
501 );
502
503 $this->add_group_control(
504 Group_Control_Box_Shadow::get_type(),
505 [
506 'name' => 'container_box_shadow',
507 'selector' => '{{WRAPPER}} p.aux-breadcrumbs'
508 ]
509 );
510
511 $this->end_controls_tab();
512
513 $this->start_controls_tab(
514 'container_tab_hover_state',
515 [
516 'label' => __( 'Hover', 'auxin-elements' ),
517 ]
518 );
519
520 $this->add_group_control(
521 Group_Control_Background::get_type(),
522 [
523 'name' => 'container_background_hover',
524 'selector' => '{{WRAPPER}} p.aux-breadcrumbs:hover',
525 'types' => [ 'classic', 'gradient']
526 ]
527 );
528
529 $this->add_group_control(
530 Group_Control_Box_Shadow::get_type(),
531 [
532 'name' => 'container_box_shadow_hover',
533 'selector' => '{{WRAPPER}} p.aux-breadcrumbs:hover'
534 ]
535 );
536
537 $this->add_control(
538 'container_transition',
539 [
540 'label' => __( 'Transition Duration', 'auxin-elements' ),
541 'type' => Controls_Manager::SLIDER,
542 'default' => [
543 'size' => 0.3,
544 ],
545 'range' => [
546 'px' => [
547 'max' => 3,
548 'step' => 0.1,
549 ],
550 ],
551 'render_type' => 'ui',
552 'selectors' => [
553 '{{WRAPPER}} p.aux-breadcrumbs' => "transition:all ease-out {{SIZE}}s;"
554 ]
555 ]
556 );
557
558 $this->end_controls_tab();
559
560 $this->end_controls_tabs();
561 // Background and Box Shadow for input - END
562
563 $this->end_controls_section();
564 }
565
566 /**
567 * Render image box widget output on the frontend.
568 *
569 * Written in PHP and used to generate the final HTML.
570 *
571 * @since 1.0.0
572 * @access protected
573 */
574 protected function render() {
575 $settings = $this->get_settings_for_display();
576
577 $home_icon = isset( $settings['show_home_icon'] ) && auxin_is_true( $settings['show_home_icon'] ) ? $settings['home_icon']['value'] : '';
578 $separator_icon = isset( $settings['separator_icon']['value'] ) ? $settings['separator_icon']['value'] : '';
579
580 echo '<div class="aux-elementor-breadcrumbs">';
581 auxin_the_breadcrumbs( $home_icon, $separator_icon );
582 echo '</div>';
583 }
584
585 }
586