PluginProbe ʕ •ᴥ•ʔ
Shortcodes and extra features for Phlox theme / 2.17.14
Shortcodes and extra features for Phlox theme v2.17.14
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 / audio.php
auxin-elements / includes / elementor / widgets Last commit date
theme-elements 6 months ago accordion.php 6 months ago audio.php 6 months ago before-after.php 6 months ago button.php 6 months ago carousel-navigation.php 6 months ago circle-chart.php 6 months ago contact-box.php 6 months ago contact-form.php 6 months ago custom-list.php 6 months ago divider.php 6 months ago gallery.php 6 months ago gmap.php 6 months ago heading-modern.php 6 months ago icon.php 6 months ago image.php 6 months ago mailchimp.php 6 months ago modern-button.php 6 months ago products-grid.php 6 months ago quote.php 6 months ago recent-comments.php 6 months ago recent-posts-grid-carousel.php 6 months ago recent-posts-land-style.php 6 months ago recent-posts-masonry.php 6 months ago recent-posts-tiles-carousel.php 6 months ago recent-posts-tiles.php 6 months ago recent-posts-timeline.php 6 months ago recent-products.php 6 months ago responsive-table.php 6 months ago search.php 6 months ago staff.php 6 months ago svg.php 6 months ago tabs.php 6 months ago testimonial.php 6 months ago text.php 6 months ago touch-slider.php 6 months ago video.php 6 months ago
audio.php
206 lines
1 <?php
2 namespace Auxin\Plugin\CoreElements\Elementor\Elements;
3
4 use Elementor\Plugin;
5 use Elementor\Widget_Base;
6 use Elementor\Controls_Manager;
7
8
9 if ( ! defined( 'ABSPATH' ) ) {
10 exit; // Exit if accessed directly.
11 }
12
13 /**
14 * Elementor 'Audio' widget.
15 *
16 * Elementor widget that displays an 'Audio' with lightbox.
17 *
18 * @since 1.0.0
19 */
20 class Audio extends Widget_Base {
21
22 /**
23 * Get widget name.
24 *
25 * Retrieve 'Audio' widget name.
26 *
27 * @since 1.0.0
28 * @access public
29 *
30 * @return string Widget name.
31 */
32 public function get_name() {
33 return 'aux_audio';
34 }
35
36 /**
37 * Get widget title.
38 *
39 * Retrieve 'Audio' widget title.
40 *
41 * @since 1.0.0
42 * @access public
43 *
44 * @return string Widget title.
45 */
46 public function get_title() {
47 return __('Audio Player', 'auxin-elements' );
48 }
49
50 public function has_widget_inner_wrapper(): bool {
51 return ! \Elementor\Plugin::$instance->experiments->is_feature_active( 'e_optimized_markup' );
52 }
53
54
55 /**
56 * Get widget icon.
57 *
58 * Retrieve 'Audio' widget icon.
59 *
60 * @since 1.0.0
61 * @access public
62 *
63 * @return string Widget icon.
64 */
65 public function get_icon() {
66 return 'eicon-play auxin-badge';
67 }
68
69 /**
70 * Get widget categories.
71 *
72 * Retrieve 'Audio' widget icon.
73 *
74 * @since 1.0.0
75 * @access public
76 *
77 * @return string Widget icon.
78 */
79 public function get_categories() {
80 return array( 'auxin-core' );
81 }
82
83 /**
84 * Register 'Audio' widget controls.
85 *
86 * Adds different input fields to allow the user to change and customize the widget settings.
87 *
88 * @since 1.0.0
89 * @access protected
90 */
91 protected function register_controls() {
92
93 /*-----------------------------------------------------------------------------------*/
94 /* audio_section
95 /*-----------------------------------------------------------------------------------*/
96
97 $this->start_controls_section(
98 'audio_section',
99 array(
100 'label' => __('Audio', 'auxin-elements' ),
101 )
102 );
103
104 $this->add_control(
105 'src',
106 array(
107 'label' => __('Audio file(MP3 or ogg)','auxin-elements' ),
108 'type' => 'aux-media',
109 'media_filter' => 'audio',
110 )
111 );
112
113 $this->add_control(
114 'autoplay',
115 array(
116 'label' => __('AutoPlay','auxin-elements' ),
117 'description' => __('Play the audio file automatically.','auxin-elements' ),
118 'type' => Controls_Manager::SWITCHER,
119 'label_on' => __( 'On', 'auxin-elements' ),
120 'label_off' => __( 'Off', 'auxin-elements' ),
121 'return_value' => 'yes',
122 'default' => 'no'
123 )
124 );
125
126 $this->add_control(
127 'loop',
128 array(
129 'label' => __('Repeat the audio','auxin-elements' ),
130 'type' => Controls_Manager::SWITCHER,
131 'label_on' => __( 'On', 'auxin-elements' ),
132 'label_off' => __( 'Off', 'auxin-elements' ),
133 'return_value' => 'yes',
134 'default' => 'yes'
135 )
136 );
137
138 $this->end_controls_section();
139
140 /*-----------------------------------------------------------------------------------*/
141 /* skin_section
142 /*-----------------------------------------------------------------------------------*/
143
144 $this->start_controls_section(
145 'skin_section',
146 array(
147 'label' => __('Skin', 'auxin-elements' ),
148 'tab' => Controls_Manager::TAB_STYLE,
149 )
150 );
151
152 $this->add_control(
153 'skin',
154 array(
155 'label' => __('Skin','auxin-elements' ),
156 'description' => __('The skin of audio element.','auxin-elements' ),
157 'type' => 'aux-visual-select',
158 'options' => array(
159 'default' => array(
160 'label' => __('Theme Default', 'auxin-elements'),
161 'image' => AUXIN_URL . 'images/visual-select/default2.svg'
162 ),
163 'dark' => array(
164 'label' => __('Dark', 'auxin-elements'),
165 'image' => AUXIN_URL . 'images/visual-select/audio-player-dark.svg'
166 ),
167 'light' => array(
168 'label' => __('Light', 'auxin-elements'),
169 'image' => AUXIN_URL . 'images/visual-select/audio-player-light.svg'
170 )
171 ),
172 'default' => 'dark'
173 )
174 );
175
176 $this->end_controls_section();
177 }
178
179 /**
180 * Render image box widget output on the frontend.
181 *
182 * Written in PHP and used to generate the final HTML.
183 *
184 * @since 1.0.0
185 * @access protected
186 */
187 protected function render() {
188
189 $settings = $this->get_settings_for_display();
190
191
192 $args = array(
193 'src' => $settings['src']['id'],
194 'loop' => $settings['loop'],
195 'autoplay' => $settings['autoplay'],
196
197 'skin' => $settings['skin'],
198 );
199
200 // get the shortcode base blog page
201 echo auxin_widget_audio_callback( $args );
202
203 }
204
205 }
206