PluginProbe ʕ •ᴥ•ʔ
Premium Addons for Elementor – Powerful Elementor Templates & Widgets / 4.10.30
Premium Addons for Elementor – Powerful Elementor Templates & Widgets v4.10.30
4.11.79 4.11.78 4.11.77 4.11.76 4.11.75 3.20.5 4.11.69 3.20.6 4.11.7 3.20.7 4.11.70 3.20.8 4.11.71 3.20.9 4.11.72 3.21.1 4.11.73 3.21.2 4.11.74 3.21.3 4.11.8 3.21.4 4.11.9 3.21.5 4.2.0 3.21.6 4.2.1 3.3.0 4.2.2 3.3.1 4.2.3 3.3.2 4.2.4 3.3.3 4.2.5 3.3.4 4.2.6 3.3.5 4.2.7 3.3.6 4.2.8 3.3.7 4.2.9 3.3.8 4.3.0 3.3.9 4.3.1 3.4.0 4.3.2 3.4.1 4.3.3 3.4.2 4.3.4 3.4.3 4.3.5 3.4.4 4.3.6 3.4.5 4.3.7 3.4.6 4.3.8 3.4.7 4.3.9 3.4.8 4.4.0 3.4.9 4.4.1 3.5.0 4.4.2 3.5.1 4.4.3 3.5.2 4.4.4 3.5.3 4.4.5 3.5.4 4.4.6 3.5.5 4.4.7 3.5.6 4.4.8 3.5.7 4.4.9 3.5.8 4.5.0 3.5.9 4.5.1 3.6.0 4.5.2 3.6.1 4.5.3 3.6.2 4.5.4 3.6.3 4.5.5 3.6.4 4.5.6 3.6.5 4.5.7 3.6.6 4.5.8 3.6.7 4.5.9 3.6.8 4.6.0 3.6.9 4.6.1 3.7.0 4.7.0 3.7.1 4.7.1 3.7.2 4.7.2 3.7.3 4.7.3 3.7.4 4.7.4 3.7.5 4.7.5 3.7.6 4.7.6 3.7.7 4.7.7 3.7.8 4.7.8 3.7.9 4.7.9 3.8.0 4.8.0 3.8.1 4.8.1 3.8.2 4.8.10 3.8.3 4.8.11 3.8.4 4.8.2 3.8.5 4.8.3 3.8.6 4.8.4 3.8.7 4.8.5 3.8.8 4.8.6 3.8.9 4.8.7 3.9.0 4.8.8 3.9.1 4.8.9 3.9.2 4.9.0 3.9.3 4.9.0-beta1 3.9.4 4.9.0-beta2 3.9.5 4.9.1 3.9.6 4.9.10 3.9.7 4.9.11 3.9.8 4.9.12 3.9.9 4.9.13 4.0.1 4.9.14 4.0.3 4.9.15 4.0.4 4.9.16 4.0.5 4.9.17 4.0.6 4.9.18 4.0.7 4.9.19 4.0.8 4.9.2 4.0.9 4.9.20 4.1.0 4.9.21 4.1.1 4.9.22 4.1.2 4.9.23 4.1.3 4.9.24 trunk 4.1.4 4.9.25 1.0 4.1.5 4.9.26 1.01 4.1.6 4.9.27 1.02 4.1.7 4.9.28 1.03 4.1.8 4.9.29 1.04 4.1.9 4.9.3 1.05 4.10.0 4.9.30 1.06 4.10.1 4.9.31 1.07 4.10.10 4.9.32 1.08 4.10.11 4.9.33 1.09 4.10.12 4.9.34 2.0 4.10.13 4.9.35 2.0.1 4.10.14 4.9.36 2.0.2 4.10.15 4.9.37 2.0.3 4.10.16 4.9.38 2.0.4 4.10.17 4.9.39 2.0.5 4.10.18 4.9.4 2.0.6 4.10.19 4.9.40 2.0.7 4.10.2 4.9.41 2.0.8 4.10.20 4.9.42 2.0.9 4.10.21 4.9.43 2.1.0 4.10.22 4.9.45 2.1.1 4.10.23 4.9.46 2.1.2 4.10.24 4.9.47 2.1.3 4.10.25 4.9.48 2.1.4 4.10.26 4.9.49 2.1.5 4.10.27 4.9.5 2.1.5-beta1 4.10.28 4.9.50 2.1.6 4.10.29 4.9.51 2.1.7 4.10.3 4.9.52 2.1.8 4.10.30 4.9.53 2.1.9 4.10.31 4.9.54 2.2.0 4.10.32 4.9.55 2.2.1 4.10.33 4.9.56 2.2.2 4.10.34 4.9.57 2.2.3 4.10.35 4.9.6 2.2.4 4.10.36 4.9.7 2.2.5 4.10.37 4.9.8 2.2.6 4.10.38 4.9.9 2.2.7 4.10.39 2.2.8 4.10.4 2.2.9 4.10.40 2.3.0 4.10.41 2.3.1 4.10.42 2.3.2 4.10.43 2.3.3 4.10.44 2.3.4 4.10.45 2.3.5 4.10.46 2.3.6 4.10.47 2.3.7 4.10.48 2.3.8 4.10.49 2.3.9 4.10.5 2.4.0 4.10.50 2.4.1 4.10.51 2.5.0 4.10.52 2.5.1 4.10.53 2.5.2 4.10.54 2.5.3 4.10.55 2.5.4 4.10.56 2.5.5 4.10.57 2.5.6 4.10.58 2.5.7 4.10.59 2.5.8 4.10.6 2.5.9 4.10.60 2.6.0 4.10.61 2.6.1 4.10.62 2.6.2 4.10.63 2.6.3 4.10.64 2.6.4 4.10.65 2.6.5 4.10.66 2.6.6 4.10.67 2.6.7 4.10.68 2.6.8 4.10.69 2.6.9 4.10.7 2.7.0 4.10.70 2.7.1 4.10.71 2.7.2 4.10.72 2.7.3 4.10.73 2.7.4 4.10.74 2.7.5 4.10.75 2.7.6 4.10.76 2.7.7 4.10.77 2.7.8 4.10.78 2.7.9 4.10.79 2.8.0 4.10.8 2.8.1 4.10.80 2.8.2 4.10.81 2.8.3 4.10.82 2.8.4 4.10.83 2.8.5 4.10.84 2.8.6 4.10.85 2.8.7 4.10.86 2.8.8 4.10.87 2.8.9 4.10.88 2.9.0 4.10.89 2.9.1 4.10.9 2.9.2 4.10.90 2.9.3 4.11.0 2.9.4 4.11.1 2.9.5 4.11.10 2.9.6 4.11.11 2.9.7 4.11.12 2.9.8 4.11.13 2.9.9 4.11.14 3.0.0 4.11.15 3.0.1 4.11.16 3.0.2 4.11.17 3.0.3 4.11.18 3.0.4 4.11.19 3.0.5 4.11.2 3.0.6 4.11.20 3.0.7 4.11.21 3.0.8 4.11.22 3.0.9 4.11.23 3.1.0 4.11.24 3.1.1 4.11.25 3.1.2 4.11.26 3.1.3 4.11.27 3.1.4 4.11.28 3.1.5 4.11.29 3.1.6 4.11.3 3.1.7 4.11.30 3.1.8 4.11.31 3.1.9 4.11.32 3.10.0 4.11.33 3.10.1 4.11.34 3.10.2 4.11.35 3.10.3 4.11.36 3.10.4 4.11.37 3.10.5 4.11.38 3.10.6 4.11.39 3.10.7 4.11.4 3.10.8 4.11.40 3.10.9 4.11.41 3.11.0 4.11.42 3.11.1 4.11.43 3.11.2 4.11.44 3.11.3 4.11.45 3.11.4 4.11.46 3.11.5 4.11.47 3.11.6 4.11.48 3.11.7 4.11.49 3.11.8 4.11.5 3.11.9 4.11.50 3.12.0 4.11.51 3.12.1 4.11.52 3.12.2 4.11.53 3.12.3 4.11.54 3.2.0 4.11.55 3.2.1 4.11.56 3.2.2 4.11.57 3.2.3 4.11.58 3.2.4 4.11.59 3.2.5 4.11.6 3.2.6 4.11.60 3.2.7 4.11.61 3.2.8 4.11.62 3.2.9 4.11.63 3.20.0 4.11.64 3.20.1 4.11.65 3.20.2 4.11.66 3.20.3 4.11.67 3.20.4 4.11.68
premium-addons-for-elementor / widgets / premium-notifications.php
premium-addons-for-elementor / widgets Last commit date
dep 2 years ago premium-banner.php 2 years ago premium-blog.php 2 years ago premium-button.php 2 years ago premium-carousel.php 2 years ago premium-contactform.php 2 years ago premium-countdown.php 2 years ago premium-counter.php 2 years ago premium-dual-header.php 2 years ago premium-fancytext.php 2 years ago premium-grid.php 2 years ago premium-icon-list.php 2 years ago premium-image-button.php 2 years ago premium-image-scroll.php 2 years ago premium-image-separator.php 2 years ago premium-lottie.php 2 years ago premium-maps.php 2 years ago premium-media-wheel.php 2 years ago premium-modalbox.php 2 years ago premium-nav-menu.php 2 years ago premium-notifications.php 2 years ago premium-person.php 2 years ago premium-pinterest-feed.php 2 years ago premium-post-ticker.php 2 years ago premium-pricing-table.php 2 years ago premium-progressbar.php 2 years ago premium-search-form.php 2 years ago premium-svg-drawer.php 2 years ago premium-tcloud.php 2 years ago premium-testimonials.php 2 years ago premium-textual-showcase.php 2 years ago premium-tiktok-feed.php 2 years ago premium-title.php 2 years ago premium-videobox.php 2 years ago premium-vscroll.php 2 years ago premium-weather.php 2 years ago premium-world-clock.php 2 years ago
premium-notifications.php
3914 lines
1 <?php
2 /**
3 * Premium Recent Posts Notifications.
4 */
5
6 namespace PremiumAddons\Widgets;
7
8 // Elementor Classes.
9 use Elementor\Icons_Manager;
10 use Elementor\Widget_Base;
11 use Elementor\Utils;
12 use Elementor\Control_Media;
13 use Elementor\Controls_Manager;
14 use Elementor\Group_Control_Border;
15 use Elementor\Group_Control_Image_Size;
16 use Elementor\Repeater;
17 use Elementor\Group_Control_Css_Filter;
18 use Elementor\Group_Control_Box_Shadow;
19 use Elementor\Group_Control_Typography;
20 use Elementor\Core\Kits\Documents\Tabs\Global_Typography;
21 use Elementor\Core\Kits\Documents\Tabs\Global_Colors;
22 use Elementor\Group_Control_Background;
23 use Elementor\Group_Control_Text_Shadow;
24
25
26 // PremiumAddons Classes.
27 use PremiumAddons\Admin\Includes\Admin_Helper;
28 use PremiumAddons\Includes\Premium_Template_Tags as Blog_Helper;
29 use PremiumAddons\Includes\Controls\Premium_Post_Filter;
30 use PremiumAddons\Includes\Helper_Functions;
31
32 if ( ! defined( 'ABSPATH' ) ) {
33 exit;
34 }
35
36 /**
37 * Class Premium_Notifications
38 */
39 class Premium_Notifications extends Widget_Base {
40
41 /**
42 * Blog Helper
43 *
44 * @var blog_helper
45 */
46 private $blog_helper = array();
47
48 /**
49 * Get Blog Helper Instance.
50 *
51 * @since 1.0.0
52 * @access public
53 */
54 public function get_blog_helper() {
55 return $this->blog_helper = Blog_Helper::getInstance();
56 }
57
58
59 /**
60 * Query Posts
61 *
62 * @var query_posts
63 */
64 private $query_posts = array();
65
66 /**
67 * Check Icon Draw Option.
68 *
69 * @since 4.9.26
70 * @access public
71 */
72 public function check_icon_draw() {
73 $is_enabled = Admin_Helper::check_svg_draw( 'premium-notifications' );
74 return $is_enabled;
75 }
76
77 /**
78 * Retrieve Widget Name.
79 *
80 * @since 1.0.0
81 * @access public
82 */
83 public function get_name() {
84 return 'premium-notifications';
85 }
86
87 /**
88 * Retrieve Widget Title.
89 *
90 * @since 1.0.0
91 * @access public
92 */
93 public function get_title() {
94 return __( 'Recent Posts Notification', 'premium-addons-for-elementor' );
95 }
96
97 /**
98 * Retrieve Widget Icon.
99 *
100 * @since 1.0.0
101 * @access public
102 *
103 * @return string widget icon.
104 */
105 public function get_icon() {
106 return 'pa-post-notifications';
107 }
108
109 /**
110 * Retrieve Widget Keywords.
111 *
112 * @since 1.0.0
113 * @access public
114 *
115 * @return string Widget keywords.
116 */
117 public function get_keywords() {
118 return array( 'pa', 'premium', 'posts', 'alert', 'recent', 'query', 'box', 'cpt', 'custom' );
119 }
120
121 /**
122 * Retrieve Widget Categories.
123 *
124 * @since 1.0.0
125 * @access public
126 *
127 * @return string Widget Categories.
128 */
129 public function get_categories() {
130 return array( 'premium-elements' );
131 }
132
133 /**
134 * Retrieve Widget Dependent CSS.
135 *
136 * @since 1.0.0
137 * @access public
138 *
139 * @return array CSS style handles.
140 */
141 public function get_style_depends() {
142 return array(
143 'premium-addons',
144 );
145 }
146
147 /**
148 * Retrieve Widget Dependent JS.
149 *
150 * @since 1.0.0
151 * @access public
152 *
153 * @return array JS script handles.
154 */
155 public function get_script_depends() {
156
157 $draw_scripts = $this->check_icon_draw() ? array(
158 'pa-fontawesome-all',
159 'pa-tweenmax',
160 'pa-motionpath',
161 ) : array();
162
163 return array_merge(
164 $draw_scripts,
165 array(
166 'lottie-js',
167 'pa-notifications',
168 )
169 );
170 }
171
172 /**
173 * Retrieve Widget Support URL.
174 *
175 * @access public
176 *
177 * @return string support URL.
178 */
179 public function get_custom_help_url() {
180 return 'https://premiumaddons.com/support/';
181 }
182
183 /**
184 * Register Image Scroll controls.
185 *
186 * @since 1.0.0
187 * @access protected
188 */
189 protected function register_controls() { // phpcs:ignore PSR2.Methods.MethodDeclaration.Underscore
190
191 $papro_activated = apply_filters( 'papro_activated', false );
192
193 $draw_icon = $this->check_icon_draw();
194
195 $options = apply_filters(
196 'pa_notification_options',
197 array(
198 'skins' => array(
199 'classic' => __( 'Classic', 'premium-addons-for-elementor' ),
200 'modern' => __( 'Modern', 'premium-addons-for-elementor' ),
201 'cards' => __( 'Cards (Pro)', 'premium-addons-for-elementor' ),
202 'banner' => __( 'Banner (Pro)', 'premium-addons-for-elementor' ),
203 ),
204 'skin_condition' => array( 'cards', 'banner' ),
205 'source_condition' => array(
206 'post_type_filter' => 'post',
207 ),
208 )
209 );
210
211 $this->start_controls_section(
212 'icon_settings',
213 array(
214 'label' => __( 'Notification Icon', 'premium-addons-for-elementor' ),
215 )
216 );
217
218 $this->add_control(
219 'icon_type',
220 array(
221 'label' => __( 'Icon Type', 'premium-addons-for-elementor' ),
222 'type' => Controls_Manager::SELECT,
223 'default' => 'icon',
224 'options' => array(
225 'icon' => __( 'Icon', 'premium-addons-for-elementor' ),
226 'image' => __( 'Image', 'premium-addons-for-elementor' ),
227 'text' => __( 'Text', 'premium-addons-for-elementor' ),
228 'animation' => __( 'Lottie Animation', 'premium-addons-for-elementor' ),
229 'svg' => __( 'SVG Code', 'premium-addons-for-elementor' ),
230 ),
231 'frontend_available' => true,
232 )
233 );
234
235 $this->add_control(
236 'icon',
237 array(
238 'label' => __( 'Icon', 'premium-addons-for-elementor' ),
239 'type' => Controls_Manager::ICONS,
240 'default' => array(
241 'value' => 'far fa-bell',
242 'library' => 'fa-regular',
243 ),
244 'condition' => array(
245 'icon_type' => 'icon',
246 ),
247 )
248 );
249
250 $this->add_control(
251 'image',
252 array(
253 'label' => __( 'Image', 'premium-addons-for-elementor' ),
254 'type' => Controls_Manager::MEDIA,
255 'media_types' => array( 'image' ),
256 'dynamic' => array( 'active' => true ),
257 'condition' => array(
258 'icon_type' => 'image',
259 ),
260 )
261 );
262
263 $this->add_control(
264 'lottie_url',
265 array(
266 'label' => __( 'Animation JSON URL', 'premium-addons-for-elementor' ),
267 'type' => Controls_Manager::TEXT,
268 'dynamic' => array( 'active' => true ),
269 'description' => 'Get JSON code URL from <a href="https://lottiefiles.com/" target="_blank">here</a>',
270 'label_block' => true,
271 'condition' => array(
272 'icon_type' => 'animation',
273 ),
274 )
275 );
276
277 $this->add_control(
278 'custom_svg',
279 array(
280 'label' => __( 'SVG Code', 'premium-addons-for-elementor' ),
281 'type' => Controls_Manager::TEXTAREA,
282 'description' => 'You can use these sites to create SVGs: <a href="https://danmarshall.github.io/google-font-to-svg-path/" target="_blank">Google Fonts</a> and <a href="https://boxy-svg.com/" target="_blank">Boxy SVG</a>',
283 'condition' => array(
284 'icon_type' => 'svg',
285 ),
286 )
287 );
288
289 $animation_conds = array(
290 'terms' => array(
291 array(
292 'relation' => 'or',
293 'terms' => array(
294 array(
295 'name' => 'icon_type',
296 'value' => 'animation',
297 ),
298 array(
299 'terms' => array(
300 array(
301 'relation' => 'or',
302 'terms' => array(
303 array(
304 'name' => 'icon_type',
305 'value' => 'icon',
306 ),
307 array(
308 'name' => 'icon_type',
309 'value' => 'svg',
310 ),
311 ),
312 ),
313 array(
314 'name' => 'draw_svg',
315 'value' => 'yes',
316 ),
317 ),
318 ),
319 ),
320 ),
321 ),
322 );
323
324 $this->add_control(
325 'draw_svg',
326 array(
327 'label' => __( 'Draw Icon', 'premium-addons-for-elementor' ),
328 'type' => Controls_Manager::SWITCHER,
329 'classes' => $draw_icon ? '' : 'editor-pa-control-disabled',
330 'condition' => array(
331 'icon_type' => array( 'icon', 'svg' ),
332 'icon[library]!' => 'svg',
333 ),
334 )
335 );
336
337 if ( $draw_icon ) {
338
339 $this->add_control(
340 'path_width',
341 array(
342 'label' => __( 'Path Thickness', 'premium-addons-for-elementor' ),
343 'type' => Controls_Manager::SLIDER,
344 'range' => array(
345 'px' => array(
346 'min' => 0,
347 'max' => 50,
348 'step' => 0.1,
349 ),
350 ),
351 'condition' => array(
352 'icon_type' => array( 'icon', 'svg' ),
353 ),
354 'selectors' => array(
355 '{{WRAPPER}} .pa-rec-not-icon-wrap svg *' => 'stroke-width: {{SIZE}}',
356 ),
357 )
358 );
359
360 $this->add_control(
361 'svg_sync',
362 array(
363 'label' => __( 'Draw All Paths Together', 'premium-addons-for-elementor' ),
364 'type' => Controls_Manager::SWITCHER,
365 'condition' => array(
366 'icon_type' => array( 'icon', 'svg' ),
367 'draw_svg' => 'yes',
368 ),
369 )
370 );
371
372 $this->add_control(
373 'frames',
374 array(
375 'label' => __( 'Speed', 'premium-addons-for-elementor' ),
376 'type' => Controls_Manager::NUMBER,
377 'description' => __( 'Larger value means longer animation duration.', 'premium-addons-for-elementor' ),
378 'default' => 5,
379 'min' => 1,
380 'max' => 100,
381 'condition' => array(
382 'icon_type' => array( 'icon', 'svg' ),
383 'draw_svg' => 'yes',
384 ),
385 )
386 );
387
388 } else {
389
390 Helper_Functions::get_draw_svg_notice(
391 $this,
392 'recent',
393 array(
394 'icon_type' => array( 'icon', 'svg' ),
395 'icon[library]!' => 'svg',
396 )
397 );
398
399 }
400
401 $this->add_control(
402 'lottie_loop',
403 array(
404 'label' => __( 'Loop', 'premium-addons-for-elementor' ),
405 'type' => Controls_Manager::SWITCHER,
406 'return_value' => 'true',
407 'default' => 'true',
408 'conditions' => $animation_conds,
409 )
410 );
411
412 $this->add_control(
413 'lottie_reverse',
414 array(
415 'label' => __( 'Reverse', 'premium-addons-for-elementor' ),
416 'type' => Controls_Manager::SWITCHER,
417 'return_value' => 'true',
418 'conditions' => $animation_conds,
419 )
420 );
421
422 if ( $draw_icon ) {
423
424 $this->add_control(
425 'start_point',
426 array(
427 'label' => __( 'Start Point (%)', 'premium-addons-for-elementor' ),
428 'type' => Controls_Manager::SLIDER,
429 'description' => __( 'Set the point that the SVG should start from.', 'premium-addons-for-elementor' ),
430 'default' => array(
431 'unit' => '%',
432 'size' => 0,
433 ),
434 'condition' => array(
435 'icon_type' => array( 'icon', 'svg' ),
436 'draw_svg' => 'yes',
437 'lottie_reverse!' => 'true',
438 ),
439
440 )
441 );
442
443 $this->add_control(
444 'end_point',
445 array(
446 'label' => __( 'End Point (%)', 'premium-addons-for-elementor' ),
447 'type' => Controls_Manager::SLIDER,
448 'description' => __( 'Set the point that the SVG should end at.', 'premium-addons-for-elementor' ),
449 'default' => array(
450 'unit' => '%',
451 'size' => 0,
452 ),
453 'condition' => array(
454 'icon_type' => array( 'icon', 'svg' ),
455 'draw_svg' => 'yes',
456 'lottie_reverse' => 'true',
457 ),
458
459 )
460 );
461
462 $this->add_control(
463 'svg_yoyo',
464 array(
465 'label' => __( 'Yoyo Effect', 'premium-addons-for-elementor' ),
466 'type' => Controls_Manager::SWITCHER,
467 'condition' => array(
468 'icon_type' => array( 'icon', 'svg' ),
469 'draw_svg' => 'yes',
470 'lottie_loop' => 'true',
471 ),
472 )
473 );
474 }
475
476 $this->add_responsive_control(
477 'icon_size',
478 array(
479 'label' => __( 'Icon Size', 'premium-addons-for-elementor' ),
480 'type' => Controls_Manager::SLIDER,
481 'size_units' => array( 'px', 'em', '%', 'custom' ),
482 'selectors' => array(
483 '{{WRAPPER}} .pa-rec-not-icon-wrap img' => 'width: {{SIZE}}{{UNIT}}',
484 // !important to override Elementor Pro lottie width/height on editor page.
485 '{{WRAPPER}} .pa-rec-not-icon-wrap svg' => 'width: {{SIZE}}{{UNIT}} !important; height: {{SIZE}}{{UNIT}} !important',
486 '{{WRAPPER}} .pa-rec-not-icon-wrap i' => 'font-size: {{SIZE}}{{UNIT}}',
487 ),
488 'condition' => array(
489 'icon_type!' => 'text',
490 ),
491 )
492 );
493
494 $this->add_group_control(
495 Group_Control_Image_Size::get_type(),
496 array(
497 'name' => 'thumbnail',
498 'default' => 'full',
499 'condition' => array(
500 'icon_type' => 'image',
501 ),
502 )
503 );
504
505 $this->add_control(
506 'text',
507 array(
508 'label' => __( 'Text', 'premium-addons-for-elementor' ),
509 'type' => Controls_Manager::TEXT,
510 'default' => __( 'What is new?', 'premium-addons-for-elementor' ),
511 'dynamic' => array( 'active' => true ),
512 'condition' => array(
513 'icon_type' => 'text',
514 ),
515 )
516 );
517
518 $this->add_control(
519 'add_icon_with_no_posts',
520 array(
521 'label' => __( 'Add Different Icon with no posts', 'premium-addons-for-elementor' ),
522 'type' => Controls_Manager::SWITCHER,
523 'frontend_available' => true,
524 )
525 );
526
527 $this->add_control(
528 'icon_with_no_posts',
529 array(
530 'label' => __( 'Icon', 'premium-addons-for-elementor' ),
531 'type' => Controls_Manager::ICONS,
532 'condition' => array(
533 'add_icon_with_no_posts' => 'yes',
534 'icon_type!' => array( 'image' ),
535 ),
536 'frontend_available' => true,
537 )
538 );
539
540 $this->add_control(
541 'image_with_no_posts',
542 array(
543 'label' => __( 'Image', 'premium-addons-for-elementor' ),
544 'type' => Controls_Manager::MEDIA,
545 'media_types' => array( 'image' ),
546 'dynamic' => array( 'active' => true ),
547 'condition' => array(
548 'icon_type' => 'image',
549 'add_icon_with_no_posts' => 'yes',
550 ),
551 )
552 );
553
554 $this->add_responsive_control(
555 'icon_align',
556 array(
557 'label' => __( 'Alignment', 'premium-addons-for-elementor' ),
558 'type' => Controls_Manager::CHOOSE,
559 'options' => array(
560 'left' => array(
561 'title' => __( 'Left', 'premium-addons-for-elementor' ),
562 'icon' => 'eicon-text-align-left',
563 ),
564 'center' => array(
565 'title' => __( 'Center', 'premium-addons-for-elementor' ),
566 'icon' => 'eicon-text-align-center',
567 ),
568 'right' => array(
569 'title' => __( 'Right', 'premium-addons-for-elementor' ),
570 'icon' => 'eicon-text-align-right',
571 ),
572 ),
573 'default' => 'center',
574 'toggle' => false,
575 'selectors' => array(
576 '{{WRAPPER}} .pa-recent-notification' => 'text-align: {{VALUE}};',
577 ),
578 )
579 );
580
581 $this->end_controls_section();
582
583 $this->start_controls_section(
584 'number_settings',
585 array(
586 'label' => __( 'Posts Number', 'premium-addons-for-elementor' ),
587 )
588 );
589
590 $this->add_control(
591 'posts_number',
592 array(
593 'label' => __( 'Number', 'premium-addons-for-elementor' ),
594 'type' => Controls_Manager::NUMBER,
595 'default' => 3,
596 'condition' => array(
597 'cookies!' => 'yes',
598 ),
599 )
600 );
601
602 $this->add_control(
603 'cookies',
604 array(
605 'label' => __( 'Use Cookies to Get Unseen Posts', 'premium-addons-for-elementor' ),
606 'type' => Controls_Manager::SWITCHER,
607 'frontend_available' => true,
608 )
609 );
610
611 $this->add_control(
612 'cookies_notice',
613 array(
614 'raw' => __( 'Use cookies option works only when logged out.', 'premium-addons-for-elementor' ),
615 'type' => Controls_Manager::RAW_HTML,
616 'content_classes' => 'elementor-panel-alert elementor-panel-alert-info',
617 'condition' => array(
618 'cookies' => 'yes',
619 ),
620 )
621 );
622
623 $this->add_control(
624 'cookies_interval',
625 array(
626 'label' => __( 'Expiration Time (days)', 'premium-addons-for-elementor' ),
627 'type' => Controls_Manager::NUMBER,
628 'description' => __( 'How many days before removing cookie, set the value in days, default is: 1 day', 'premium-addons-for-elementor' ),
629 'default' => 1,
630 'min' => 0,
631 'condition' => array(
632 'cookies' => 'yes',
633 ),
634 'frontend_available' => true,
635 )
636 );
637
638 $this->add_responsive_control(
639 'number_box_size',
640 array(
641 'label' => __( 'Numbers Box Size', 'premium-addons-for-elementor' ),
642 'type' => Controls_Manager::SLIDER,
643 'size_units' => array( 'px', 'em', '%', 'custom' ),
644 'selectors' => array(
645 '{{WRAPPER}} .pa-rec-not-number' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}}',
646 ),
647 )
648 );
649
650 $this->add_responsive_control(
651 'number_box_h',
652 array(
653 'label' => __( 'Horizontal Position', 'premium-addons-for-elementor' ),
654 'type' => Controls_Manager::SLIDER,
655 'size_units' => array( 'px', 'em', '%' ),
656 'label_block' => true,
657 'selectors' => array(
658 '{{WRAPPER}} .pa-rec-not-number' => 'right: {{SIZE}}{{UNIT}};',
659 ),
660 )
661 );
662
663 $this->add_responsive_control(
664 'number_box_v',
665 array(
666 'label' => __( 'Vertical Position', 'premium-addons-for-elementor' ),
667 'type' => Controls_Manager::SLIDER,
668 'size_units' => array( 'px', 'em', '%' ),
669 'label_block' => true,
670 'selectors' => array(
671 '{{WRAPPER}} .pa-rec-not-number' => 'top: {{SIZE}}{{UNIT}};',
672 ),
673 )
674 );
675
676 $this->end_controls_section();
677
678 $this->start_controls_section(
679 'posts_box_settings',
680 array(
681 'label' => __( 'Posts Box', 'premium-addons-for-elementor' ),
682 )
683 );
684
685 $this->add_responsive_control(
686 'posts_box_width',
687 array(
688 'label' => __( 'Width', 'premium-addons-for-elementor' ),
689 'type' => Controls_Manager::SLIDER,
690 'size_units' => array( 'px', '%', 'vw', 'custom' ),
691 'range' => array(
692 'px' => array(
693 'min' => 1,
694 'max' => 1000,
695 ),
696 ),
697 'selectors' => array(
698 '{{WRAPPER}} .pa-rec-posts-container' => 'width: {{SIZE}}{{UNIT}};',
699 '{{WRAPPER}}' => '--pa-recent-posts-width: {{SIZE}}{{UNIT}}',
700 ),
701 'frontend_available' => true,
702 )
703 );
704
705 $this->add_responsive_control(
706 'posts_box_height',
707 array(
708 'label' => __( 'Max Height', 'premium-addons-for-elementor' ),
709 'type' => Controls_Manager::SLIDER,
710 'size_units' => array( 'px', 'em', 'vh', 'custom' ),
711 'range' => array(
712 'px' => array(
713 'min' => 50,
714 'max' => 1500,
715 ),
716 'em' => array(
717 'min' => 1,
718 'max' => 50,
719 ),
720 ),
721 'label_block' => true,
722 'selectors' => array(
723 '{{WRAPPER}} .pa-rec-posts-body' => 'max-height: {{SIZE}}{{UNIT}};',
724 ),
725 )
726 );
727
728 $this->add_control(
729 'posts_box_position',
730 array(
731 'label' => __( 'Position', 'premium-addons-for-elementor' ),
732 'type' => Controls_Manager::SELECT,
733 'prefix_class' => 'pa-container-',
734 'options' => array(
735 'left' => __( 'Left', 'premium-addons-for-elementor' ),
736 'right' => __( 'Right', 'premium-addons-for-elementor' ),
737 ),
738 'default' => 'right',
739 'render_type' => 'template',
740 'frontend_available' => true,
741 )
742 );
743
744 $this->add_control(
745 'posts_animation',
746 array(
747 'label' => __( 'Posts Entrance Animation', 'premium-addons-for-elementor' ),
748 'type' => Controls_Manager::ANIMATION,
749 'default' => 'fadeInUp',
750 'label_block' => true,
751 'frontend_available' => true,
752
753 )
754 );
755
756 $this->add_control(
757 'posts_animation_individial',
758 array(
759 'label' => __( 'Apply Animation on Posts Individually', 'premium-addons-for-elementor' ),
760 'type' => Controls_Manager::SWITCHER,
761 'condition' => array(
762 'posts_animation!' => '',
763 ),
764 'frontend_available' => true,
765 )
766 );
767
768 $this->add_control(
769 'overlay',
770 array(
771 'label' => __( 'Show Overlay', 'premium-addons-for-elementor' ),
772 'type' => Controls_Manager::SWITCHER,
773 'frontend_available' => true,
774 )
775 );
776
777 $this->add_control(
778 'shown_content',
779 array(
780 'label' => __( 'What To Show When No Posts', 'premium-addons-for-elementor' ),
781 'type' => Controls_Manager::SELECT,
782 'options' => array(
783 'posts' => __( 'Same Posts', 'premium-addons-for-elementor' ),
784 'template' => __( 'Elementor Template', 'premium-addons-for-elementor' ),
785 ),
786 'default' => 'posts',
787 'condition' => array(
788 'cookies' => 'yes',
789 ),
790 )
791 );
792
793 $this->add_control(
794 'live_temp_content',
795 array(
796 'label' => __( 'Template Title', 'premium-addons-for-elementor' ),
797 'type' => Controls_Manager::TEXT,
798 'classes' => 'premium-live-temp-title control-hidden',
799 'label_block' => true,
800 'condition' => array(
801 'cookies' => 'yes',
802 'shown_content' => 'template',
803 ),
804 )
805 );
806
807 $this->add_control(
808 'content_temp_live_btn',
809 array(
810 'type' => Controls_Manager::BUTTON,
811 'label_block' => true,
812 'button_type' => 'default papro-btn-block',
813 'text' => __( 'Create / Edit Template', 'premium-addons-for-elementor' ),
814 'event' => 'createLiveTemp',
815 'condition' => array(
816 'cookies' => 'yes',
817 'shown_content' => 'template',
818 ),
819 )
820 );
821
822 $this->add_control(
823 'content_temp',
824 array(
825 'label' => __( 'OR Select Existing Template', 'premium-addons-for-elementor' ),
826 'type' => Controls_Manager::SELECT2,
827 'label_block' => true,
828 'classes' => 'premium-live-temp-label',
829 'options' => $this->get_blog_helper()->get_elementor_page_list(),
830 'condition' => array(
831 'cookies' => 'yes',
832 'shown_content' => 'template',
833 ),
834 )
835 );
836
837 $this->end_controls_section();
838
839 $this->start_controls_section(
840 'header_settings',
841 array(
842 'label' => __( 'Posts Box Header', 'premium-addons-for-elementor' ),
843 )
844 );
845
846 $this->add_control(
847 'header_text',
848 array(
849 'label' => __( 'Title Text', 'premium-addons-for-elementor' ),
850 'type' => Controls_Manager::TEXT,
851 'dynamic' => array( 'active' => true ),
852 'default' => __( 'What\'s New?', 'premium-addons-for-elementor' ),
853 'label_block' => true,
854 )
855 );
856
857 $this->add_control(
858 'header_animation',
859 array(
860 'label' => __( 'Title Entrance Animation', 'premium-addons-for-elementor' ),
861 'type' => Controls_Manager::ANIMATION,
862 'default' => 'fadeInDown',
863 'label_block' => true,
864 'frontend_available' => true,
865
866 )
867 );
868
869 $this->add_control(
870 'header_size',
871 array(
872 'label' => __( 'HTML Tag', 'premium-addons-for-elementor' ),
873 'type' => Controls_Manager::SELECT,
874 'default' => 'h3',
875 'options' => array(
876 'h1' => 'H1',
877 'h2' => 'H2',
878 'h3' => 'H3',
879 'h4' => 'H4',
880 'h5' => 'H5',
881 'h6' => 'H6',
882 'div' => 'div',
883 'span' => 'span',
884 'p' => 'p',
885 ),
886 'label_block' => true,
887 )
888 );
889
890 $this->add_control(
891 'header_icon_sw',
892 array(
893 'label' => __( 'Icon', 'premium-addons-for-elementor' ),
894 'type' => Controls_Manager::SWITCHER,
895 'frontend_available' => true,
896 )
897 );
898
899 $this->add_control(
900 'header_icon_type',
901 array(
902 'label' => __( 'Icon Type', 'premium-addons-for-elementor' ),
903 'type' => Controls_Manager::SELECT,
904 'default' => 'icon',
905 'options' => array(
906 'icon' => __( 'Icon', 'premium-addons-for-elementor' ),
907 'image' => __( 'Image', 'premium-addons-for-elementor' ),
908 'animation' => __( 'Lottie Animation', 'premium-addons-for-elementor' ),
909 'svg' => __( 'SVG Code', 'premium-addons-for-elementor' ),
910 ),
911 'condition' => array(
912 'header_icon_sw' => 'yes',
913 ),
914 )
915 );
916
917 $this->add_control(
918 'header_icon',
919 array(
920 'label' => __( 'Icon', 'premium-addons-for-elementor' ),
921 'type' => Controls_Manager::ICONS,
922 'default' => array(
923 'value' => 'far fa-bell',
924 'library' => 'fa-regular',
925 ),
926 'condition' => array(
927 'header_icon_sw' => 'yes',
928 'header_icon_type' => 'icon',
929 ),
930 )
931 );
932
933 $this->add_control(
934 'header_image',
935 array(
936 'label' => __( 'Image', 'premium-addons-for-elementor' ),
937 'type' => Controls_Manager::MEDIA,
938 'media_types' => array( 'image' ),
939 'dynamic' => array( 'active' => true ),
940 'condition' => array(
941 'header_icon_sw' => 'yes',
942 'header_icon_type' => 'image',
943 ),
944 )
945 );
946
947 $this->add_control(
948 'header_lottie_url',
949 array(
950 'label' => __( 'Animation JSON URL', 'premium-addons-for-elementor' ),
951 'type' => Controls_Manager::TEXT,
952 'dynamic' => array( 'active' => true ),
953 'description' => 'Get JSON code URL from <a href="https://lottiefiles.com/" target="_blank">here</a>',
954 'label_block' => true,
955 'condition' => array(
956 'header_icon_sw' => 'yes',
957 'header_icon_type' => 'animation',
958 ),
959 )
960 );
961
962 $this->add_control(
963 'header_custom_svg',
964 array(
965 'label' => __( 'SVG Code', 'premium-addons-for-elementor' ),
966 'type' => Controls_Manager::TEXTAREA,
967 'description' => 'You can use these sites to create SVGs: <a href="https://danmarshall.github.io/google-font-to-svg-path/" target="_blank">Google Fonts</a> and <a href="https://boxy-svg.com/" target="_blank">Boxy SVG</a>',
968 'condition' => array(
969 'header_icon_sw' => 'yes',
970 'header_icon_type' => 'svg',
971 ),
972 )
973 );
974
975 $header_animation_conds = array(
976 'terms' => array(
977 array(
978 'name' => 'header_icon_sw',
979 'value' => 'yes',
980 ),
981 array(
982 'relation' => 'or',
983 'terms' => array(
984 array(
985 'name' => 'header_icon_type',
986 'value' => 'animation',
987 ),
988 array(
989 'terms' => array(
990 array(
991 'relation' => 'or',
992 'terms' => array(
993 array(
994 'name' => 'header_icon_type',
995 'value' => 'icon',
996 ),
997 array(
998 'name' => 'header_icon_type',
999 'value' => 'svg',
1000 ),
1001 ),
1002 ),
1003 array(
1004 'name' => 'header_draw_svg',
1005 'value' => 'yes',
1006 ),
1007 ),
1008 ),
1009 ),
1010 ),
1011 ),
1012 );
1013
1014 $this->add_control(
1015 'header_draw_svg',
1016 array(
1017 'label' => __( 'Draw Icon', 'premium-addons-for-elementor' ),
1018 'type' => Controls_Manager::SWITCHER,
1019 'classes' => $draw_icon ? '' : 'editor-pa-control-disabled',
1020 'condition' => array(
1021 'header_icon_sw' => 'yes',
1022 'header_icon_type' => array( 'icon', 'svg' ),
1023 'header_icon[library]!' => 'svg',
1024 ),
1025 )
1026 );
1027
1028 if ( $draw_icon ) {
1029
1030 $this->add_control(
1031 'header_path_width',
1032 array(
1033 'label' => __( 'Path Thickness', 'premium-addons-for-elementor' ),
1034 'type' => Controls_Manager::SLIDER,
1035 'range' => array(
1036 'px' => array(
1037 'min' => 0,
1038 'max' => 50,
1039 'step' => 0.1,
1040 ),
1041 ),
1042 'condition' => array(
1043 'header_icon_sw' => 'yes',
1044 'header_icon_type' => array( 'icon', 'svg' ),
1045 ),
1046 'selectors' => array(
1047 '{{WRAPPER}} .pa-rec-title-icon-wrap svg *' => 'stroke-width: {{SIZE}}',
1048 ),
1049 )
1050 );
1051
1052 $this->add_control(
1053 'header_svg_sync',
1054 array(
1055 'label' => __( 'Draw All Paths Together', 'premium-addons-for-elementor' ),
1056 'type' => Controls_Manager::SWITCHER,
1057 'condition' => array(
1058 'header_icon_sw' => 'yes',
1059 'header_icon_type' => array( 'icon', 'svg' ),
1060 'header_draw_svg' => 'yes',
1061 ),
1062 )
1063 );
1064
1065 $this->add_control(
1066 'header_frames',
1067 array(
1068 'label' => __( 'Speed', 'premium-addons-for-elementor' ),
1069 'type' => Controls_Manager::NUMBER,
1070 'description' => __( 'Larger value means longer animation duration.', 'premium-addons-for-elementor' ),
1071 'default' => 5,
1072 'min' => 1,
1073 'max' => 100,
1074 'condition' => array(
1075 'header_icon_sw' => 'yes',
1076 'header_icon_type' => array( 'icon', 'svg' ),
1077 'header_draw_svg' => 'yes',
1078 ),
1079 )
1080 );
1081
1082 } else {
1083
1084 Helper_Functions::get_draw_svg_notice(
1085 $this,
1086 'recent',
1087 array(
1088 'header_icon_sw' => 'yes',
1089 'header_icon_type' => array( 'icon', 'svg' ),
1090 'header_icon[library]!' => 'svg',
1091 )
1092 );
1093
1094 }
1095
1096 $this->add_control(
1097 'header_lottie_loop',
1098 array(
1099 'label' => __( 'Loop', 'premium-addons-for-elementor' ),
1100 'type' => Controls_Manager::SWITCHER,
1101 'return_value' => 'true',
1102 'default' => 'true',
1103 'conditions' => $header_animation_conds,
1104 )
1105 );
1106
1107 if ( $draw_icon ) {
1108
1109 $this->add_control(
1110 'header_svg_yoyo',
1111 array(
1112 'label' => __( 'Yoyo Effect', 'premium-addons-for-elementor' ),
1113 'type' => Controls_Manager::SWITCHER,
1114 'condition' => array(
1115 'header_icon_sw' => 'yes',
1116 'header_icon_type' => array( 'icon', 'svg' ),
1117 'header_draw_svg' => 'yes',
1118 'header_lottie_loop' => 'true',
1119 ),
1120 )
1121 );
1122 }
1123
1124 $this->add_responsive_control(
1125 'header_icon_size',
1126 array(
1127 'label' => __( 'Icon Size', 'premium-addons-for-elementor' ),
1128 'type' => Controls_Manager::SLIDER,
1129 'size_units' => array( 'px', 'em', '%', 'custom' ),
1130 'selectors' => array(
1131 '{{WRAPPER}} .pa-rec-title-icon-wrap img' => 'width: {{SIZE}}{{UNIT}}',
1132 // !important to override Elementor Pro lottie width/height on editor page.
1133 '{{WRAPPER}} .pa-rec-title-icon-wrap svg' => 'width: {{SIZE}}{{UNIT}} !important; height: {{SIZE}}{{UNIT}} !important',
1134 '{{WRAPPER}} .pa-rec-title-icon-wrap i' => 'font-size: {{SIZE}}{{UNIT}}',
1135 ),
1136 'condition' => array(
1137 'header_icon_sw' => 'yes',
1138 ),
1139 )
1140 );
1141
1142 $this->add_responsive_control(
1143 'icon_spacing',
1144 array(
1145 'label' => __( 'Spacing (px)', 'premium-addons-for-elementor' ),
1146 'type' => Controls_Manager::SLIDER,
1147 'selectors' => array(
1148 '{{WRAPPER}} .pa-rec-title-wrap' => 'column-gap: {{SIZE}}px',
1149 ),
1150 'condition' => array(
1151 'header_icon_sw' => 'yes',
1152 ),
1153 )
1154 );
1155
1156 $this->add_responsive_control(
1157 'close_v',
1158 array(
1159 'label' => __( 'Close Icon Position', 'premium-addons-for-elementor' ),
1160 'type' => Controls_Manager::CHOOSE,
1161 'options' => array(
1162 'flex-start' => array(
1163 'title' => __( 'Top', 'premium-addons-for-elementor' ),
1164 'icon' => 'eicon-arrow-up',
1165 ),
1166 'center' => array(
1167 'title' => __( 'Middle', 'premium-addons-for-elementor' ),
1168 'icon' => 'eicon-text-align-justify',
1169 ),
1170 'flex-end' => array(
1171 'title' => __( 'Bottom', 'premium-addons-for-elementor' ),
1172 'icon' => 'eicon-arrow-down',
1173 ),
1174 ),
1175 'separator' => 'before',
1176 'default' => 'flex-start',
1177 'toggle' => false,
1178 'selectors' => array(
1179 '{{WRAPPER}} .pa-rec-posts-close' => 'align-self: {{VALUE}};',
1180 ),
1181 )
1182 );
1183
1184 $this->end_controls_section();
1185
1186 $this->start_controls_section(
1187 'section_query_options',
1188 array(
1189 'label' => __( 'Query', 'premium-addons-for-elementor' ),
1190 )
1191 );
1192
1193 $post_types = Blog_Helper::get_posts_types();
1194
1195 foreach ( $post_types as $id => $label ) {
1196
1197 if ( 'post' !== $id ) {
1198 $post_types[ $id ] .= apply_filters( 'pa_pro_label', __( ' (Pro)', 'premium-addons-for-elementor' ) );
1199 }
1200 }
1201
1202 $this->add_control(
1203 'post_type_filter',
1204 array(
1205 'label' => __( 'Post Type', 'premium-addons-for-elementor' ),
1206 'type' => Controls_Manager::SELECT,
1207 'label_block' => true,
1208 'options' => $post_types,
1209 'default' => 'post',
1210 'separator' => 'after',
1211 )
1212 );
1213
1214 $this->add_control(
1215 'premium_blog_number_of_posts',
1216 array(
1217 'label' => __( 'Posts to Load', 'premium-addons-for-elementor' ),
1218 'type' => Controls_Manager::NUMBER,
1219 'min' => 1,
1220 'default' => 5,
1221 'condition' => $options['source_condition'],
1222 )
1223 );
1224
1225 foreach ( $post_types as $key => $type ) {
1226
1227 // Get all the taxanomies associated with the selected post type.
1228 $taxonomy = Blog_Helper::get_taxnomies( $key );
1229
1230 if ( ! empty( $taxonomy ) ) {
1231
1232 // Get all taxonomy values under the taxonomy.
1233 foreach ( $taxonomy as $index => $tax ) {
1234
1235 $terms = get_terms( $index, array( 'hide_empty' => false ) );
1236
1237 $related_tax = array();
1238
1239 if ( ! empty( $terms ) ) {
1240
1241 foreach ( $terms as $t_index => $t_obj ) {
1242
1243 $related_tax[ $t_obj->slug ] = $t_obj->name;
1244 }
1245
1246 // Add filter rule for the each taxonomy.
1247 $this->add_control(
1248 $index . '_' . $key . '_filter_rule',
1249 array(
1250 /* translators: %s Taxnomy Label */
1251 'label' => sprintf( __( '%s Filter Rule', 'premium-addons-for-elementor' ), $tax->label ),
1252 'type' => Controls_Manager::SELECT,
1253 'default' => 'IN',
1254 'label_block' => true,
1255 'options' => array(
1256 /* translators: %s: Taxnomy Label */
1257 'IN' => sprintf( __( 'Match %s', 'premium-addons-for-elementor' ), $tax->label ),
1258 /* translators: %s: Taxnomy Label */
1259 'NOT IN' => sprintf( __( 'Exclude %s', 'premium-addons-for-elementor' ), $tax->label ),
1260 ),
1261 'condition' => array(
1262 'post_type_filter' => $key,
1263 ),
1264 )
1265 );
1266
1267 // Add select control for each taxonomy.
1268 $this->add_control(
1269 'tax_' . $index . '_' . $key . '_filter',
1270 array(
1271 /* translators: %s Taxnomy Label */
1272 'label' => sprintf( __( '%s Filter', 'premium-addons-for-elementor' ), $tax->label ),
1273 'type' => Controls_Manager::SELECT2,
1274 'default' => '',
1275 'multiple' => true,
1276 'label_block' => true,
1277 'options' => $related_tax,
1278 'condition' => array(
1279 'post_type_filter' => $key,
1280 ),
1281 'separator' => 'after',
1282 )
1283 );
1284
1285 }
1286 }
1287 }
1288 }
1289
1290 $this->add_control(
1291 'author_filter_rule',
1292 array(
1293 'label' => __( 'Filter By Author Rule', 'premium-addons-for-elementor' ),
1294 'type' => Controls_Manager::SELECT,
1295 'default' => 'author__in',
1296 'separator' => 'before',
1297 'label_block' => true,
1298 'options' => array(
1299 'author__in' => __( 'Match Authors', 'premium-addons-for-elementor' ),
1300 'author__not_in' => __( 'Exclude Authors', 'premium-addons-for-elementor' ),
1301 ),
1302 'condition' => $options['source_condition'],
1303 )
1304 );
1305
1306 $this->add_control(
1307 'premium_blog_users',
1308 array(
1309 'label' => __( 'Authors', 'premium-addons-for-elementor' ),
1310 'type' => Controls_Manager::SELECT2,
1311 'label_block' => true,
1312 'multiple' => true,
1313 'options' => Blog_Helper::get_authors(),
1314 'condition' => $options['source_condition'],
1315 )
1316 );
1317
1318 $this->add_control(
1319 'posts_filter_rule',
1320 array(
1321 'label' => __( 'Filter By Post Rule', 'premium-addons-for-elementor' ),
1322 'type' => Controls_Manager::SELECT,
1323 'default' => 'post__not_in',
1324 'separator' => 'before',
1325 'label_block' => true,
1326 'options' => array(
1327 'post__in' => __( 'Match Post', 'premium-addons-for-elementor' ),
1328 'post__not_in' => __( 'Exclude Post', 'premium-addons-for-elementor' ),
1329 ),
1330 'condition' => $options['source_condition'],
1331 )
1332 );
1333
1334 $this->add_control(
1335 'premium_blog_posts_exclude',
1336 array(
1337 'label' => __( 'Posts', 'premium-addons-for-elementor' ),
1338 'type' => Controls_Manager::SELECT2,
1339 'label_block' => true,
1340 'multiple' => true,
1341 'options' => Blog_Helper::get_default_posts_list( 'post' ),
1342 'condition' => $options['source_condition'],
1343 )
1344 );
1345
1346 if ( $papro_activated ) {
1347
1348 $this->add_control(
1349 'custom_posts_filter',
1350 array(
1351 'label' => __( 'Posts', 'premium-addons-for-elementor' ),
1352 'type' => Premium_Post_Filter::TYPE,
1353 'render_type' => 'template',
1354 'label_block' => true,
1355 'multiple' => true,
1356 'frontend_available' => true,
1357 'condition' => array(
1358 'post_type_filter!' => 'post',
1359 ),
1360 )
1361 );
1362
1363 }
1364
1365 $this->add_control(
1366 'ignore_sticky_posts',
1367 array(
1368 'label' => __( 'Ignore Sticky Posts', 'premium-addons-for-elementor' ),
1369 'type' => Controls_Manager::SWITCHER,
1370 'label_on' => __( 'Yes', 'premium-addons-for-elementor' ),
1371 'label_off' => __( 'No', 'premium-addons-for-elementor' ),
1372 'default' => 'yes',
1373 'condition' => $options['source_condition'],
1374 )
1375 );
1376
1377 $this->add_control(
1378 'premium_blog_offset',
1379 array(
1380 'label' => __( 'Offset', 'premium-addons-for-elementor' ),
1381 'description' => __( 'This option is used to exclude number of initial posts from being display.', 'premium-addons-for-elementor' ),
1382 'type' => Controls_Manager::NUMBER,
1383 'default' => '0',
1384 'min' => '0',
1385 'condition' => $options['source_condition'],
1386 )
1387 );
1388
1389 $this->add_control(
1390 'query_exclude_current',
1391 array(
1392 'label' => __( 'Exclude Current Post', 'premium-addons-for-elementor' ),
1393 'type' => Controls_Manager::SWITCHER,
1394 'description' => __( 'This option will remove the current post from the query.', 'premium-addons-for-elementor' ),
1395 'label_on' => __( 'Yes', 'premium-addons-for-elementor' ),
1396 'label_off' => __( 'No', 'premium-addons-for-elementor' ),
1397 'condition' => $options['source_condition'],
1398 )
1399 );
1400
1401 $this->add_control(
1402 'posts_from',
1403 array(
1404 'label' => __( 'Get Posts From', 'premium-addons-for-elementor' ),
1405 'type' => Controls_Manager::SELECT,
1406 'options' => array(
1407 '' => __( 'All Time', 'premium-addons-for-elementor' ),
1408 'day' => __( 'Day', 'premium-addons-for-elementor' ),
1409 'week' => __( 'Week', 'premium-addons-for-elementor' ),
1410 'month' => __( 'Month', 'premium-addons-for-elementor' ),
1411 'year' => __( 'Year', 'premium-addons-for-elementor' ),
1412 ),
1413 'condition' => $options['source_condition'],
1414 )
1415 );
1416
1417 $this->add_control(
1418 'premium_blog_order_by',
1419 array(
1420 'label' => __( 'Order By', 'premium-addons-for-elementor' ),
1421 'type' => Controls_Manager::SELECT,
1422 'separator' => 'before',
1423 'label_block' => true,
1424 'options' => array(
1425 'none' => __( 'None', 'premium-addons-for-elementor' ),
1426 'ID' => __( 'ID', 'premium-addons-for-elementor' ),
1427 'author' => __( 'Author', 'premium-addons-for-elementor' ),
1428 'title' => __( 'Title', 'premium-addons-for-elementor' ),
1429 'name' => __( 'Name', 'premium-addons-for-elementor' ),
1430 'date' => __( 'Date', 'premium-addons-for-elementor' ),
1431 'modified' => __( 'Last Modified', 'premium-addons-for-elementor' ),
1432 'rand' => __( 'Random', 'premium-addons-for-elementor' ),
1433 'comment_count' => __( 'Number of Comments', 'premium-addons-for-elementor' ),
1434 ),
1435 'default' => 'date',
1436 'condition' => $options['source_condition'],
1437 )
1438 );
1439
1440 $this->add_control(
1441 'premium_blog_order',
1442 array(
1443 'label' => __( 'Order', 'premium-addons-for-elementor' ),
1444 'type' => Controls_Manager::SELECT,
1445 'label_block' => true,
1446 'options' => array(
1447 'DESC' => __( 'Descending', 'premium-addons-for-elementor' ),
1448 'ASC' => __( 'Ascending', 'premium-addons-for-elementor' ),
1449 ),
1450 'default' => 'DESC',
1451 'condition' => $options['source_condition'],
1452 )
1453 );
1454
1455 $this->end_controls_section();
1456
1457 $this->start_controls_section(
1458 'post_settings',
1459 array(
1460 'label' => __( 'Post Options', 'premium-addons-for-elementor' ),
1461 )
1462 );
1463
1464 $this->add_control(
1465 'premium_blog_article_tag_switcher',
1466 array(
1467 'label' => __( 'Change Post Html Tag To Article', 'premium-addons-for-elementor' ),
1468 'type' => Controls_Manager::SWITCHER,
1469 'default' => 'yes',
1470 )
1471 );
1472
1473 $this->add_control(
1474 'premium_blog_new_tab',
1475 array(
1476 'label' => __( 'Open Links in New Tab', 'premium-addons-for-elementor' ),
1477 'type' => Controls_Manager::SWITCHER,
1478 'default' => 'yes',
1479 )
1480 );
1481
1482 $this->add_control(
1483 'premium_blog_skin',
1484 array(
1485 'label' => __( 'Skin', 'premium-addons-for-elementor' ),
1486 'type' => Controls_Manager::SELECT,
1487 'options' => $options['skins'],
1488 'default' => 'classic',
1489 'label_block' => true,
1490 )
1491 );
1492
1493 $get_pro = Helper_Functions::get_campaign_link( 'https://premiumaddons.com/pro', 'editor-page', 'wp-editor', 'get-pro' );
1494
1495 $this->add_control(
1496 'notification_notice',
1497 array(
1498 'type' => Controls_Manager::RAW_HTML,
1499 'raw' => __( 'This option is available in Premium Addons Pro. ', 'premium-addons-for-elementor' ) . '<a href="' . esc_url( $get_pro ) . '" target="_blank">' . __( 'Upgrade now!', 'premium-addons-for-elementor' ) . '</a>',
1500 'content_classes' => 'papro-upgrade-notice',
1501 'condition' => array(
1502 'premium_blog_skin' => $options['skin_condition'],
1503 ),
1504 )
1505 );
1506
1507 $this->add_control(
1508 'premium_blog_author_img_switcher',
1509 array(
1510 'label' => __( 'Show Author Image', 'premium-addons-for-elementor' ),
1511 'type' => Controls_Manager::SWITCHER,
1512 'default' => 'yes',
1513 'condition' => array(
1514 'premium_blog_skin' => 'cards',
1515 ),
1516 )
1517 );
1518
1519 $this->add_responsive_control(
1520 'content_offset',
1521 array(
1522 'label' => __( 'Content Offset', 'premium-addons-for-elementor' ),
1523 'type' => Controls_Manager::SLIDER,
1524 'range' => array(
1525 'px' => array(
1526 'min' => -100,
1527 'max' => 100,
1528 ),
1529 ),
1530 'condition' => array(
1531 'premium_blog_skin' => 'modern',
1532 ),
1533 'selectors' => array(
1534 '{{WRAPPER}} .premium-blog-skin-modern .premium-blog-content-wrapper' => 'top: {{SIZE}}{{UNIT}}',
1535 ),
1536 )
1537 );
1538
1539 $this->add_control(
1540 'premium_blog_title_tag',
1541 array(
1542 'label' => __( 'Title HTML Tag', 'premium-addons-for-elementor' ),
1543 'description' => __( 'Select a heading tag for the post title.', 'premium-addons-for-elementor' ),
1544 'type' => Controls_Manager::SELECT,
1545 'default' => 'h2',
1546 'options' => array(
1547 'h1' => 'H1',
1548 'h2' => 'H2',
1549 'h3' => 'H3',
1550 'h4' => 'H4',
1551 'h5' => 'H5',
1552 'h6' => 'H6',
1553 'div' => 'div',
1554 'span' => 'span',
1555 'p' => 'p',
1556 ),
1557 'label_block' => true,
1558 )
1559 );
1560
1561 $this->add_control(
1562 'premium_blog_excerpt',
1563 array(
1564 'label' => __( 'Show Post Content', 'premium-addons-for-elementor' ),
1565 'type' => Controls_Manager::SWITCHER,
1566 'default' => 'yes',
1567 )
1568 );
1569
1570 $this->add_control(
1571 'content_source',
1572 array(
1573 'label' => __( 'Get Content From', 'premium-addons-for-elementor' ),
1574 'type' => Controls_Manager::SELECT,
1575 'options' => array(
1576 'excerpt' => __( 'Post Excerpt', 'premium-addons-for-elementor' ),
1577 'full' => __( 'Post Full Content', 'premium-addons-for-elementor' ),
1578 ),
1579 'default' => 'excerpt',
1580 'label_block' => true,
1581 'condition' => array(
1582 'premium_blog_excerpt' => 'yes',
1583 ),
1584 )
1585 );
1586
1587 $this->add_control(
1588 'premium_blog_excerpt_length',
1589 array(
1590 'label' => __( 'Excerpt Length', 'premium-addons-for-elementor' ),
1591 'type' => Controls_Manager::NUMBER,
1592 'default' => 22,
1593 'condition' => array(
1594 'premium_blog_excerpt' => 'yes',
1595 'content_source' => 'excerpt',
1596 ),
1597 )
1598 );
1599
1600 $this->add_control(
1601 'premium_blog_excerpt_type',
1602 array(
1603 'label' => __( 'Excerpt Type', 'premium-addons-for-elementor' ),
1604 'type' => Controls_Manager::SELECT,
1605 'options' => array(
1606 'dots' => __( 'Dots', 'premium-addons-for-elementor' ),
1607 'link' => __( 'Link', 'premium-addons-for-elementor' ),
1608 ),
1609 'default' => 'dots',
1610 'label_block' => true,
1611 'condition' => array(
1612 'premium_blog_excerpt' => 'yes',
1613 ),
1614 )
1615 );
1616
1617 $this->add_control(
1618 'read_more_full_width',
1619 array(
1620 'label' => __( 'Full Width', 'premium-addons-for-elementor' ),
1621 'type' => Controls_Manager::SWITCHER,
1622 'prefix_class' => 'premium-blog-cta-full-',
1623 'condition' => array(
1624 'premium_blog_excerpt' => 'yes',
1625 'premium_blog_excerpt_type' => 'link',
1626 ),
1627 )
1628 );
1629
1630 $this->add_control(
1631 'premium_blog_excerpt_text',
1632 array(
1633 'label' => __( 'Read More Text', 'premium-addons-for-elementor' ),
1634 'type' => Controls_Manager::TEXT,
1635 'default' => __( 'Read More »', 'premium-addons-for-elementor' ),
1636 'condition' => array(
1637 'premium_blog_excerpt' => 'yes',
1638 'premium_blog_excerpt_type' => 'link',
1639 ),
1640 )
1641 );
1642
1643 $this->add_control(
1644 'premium_blog_author_meta',
1645 array(
1646 'label' => __( 'Author Meta', 'premium-addons-for-elementor' ),
1647 'type' => Controls_Manager::SWITCHER,
1648 'default' => 'yes',
1649 )
1650 );
1651
1652 $this->add_control(
1653 'premium_blog_date_meta',
1654 array(
1655 'label' => __( 'Date Meta', 'premium-addons-for-elementor' ),
1656 'type' => Controls_Manager::SWITCHER,
1657 'default' => 'yes',
1658 )
1659 );
1660
1661 $this->add_control(
1662 'premium_blog_categories_meta',
1663 array(
1664 'label' => __( 'Categories Meta', 'premium-addons-for-elementor' ),
1665 'type' => Controls_Manager::SWITCHER,
1666 'description' => __( 'Display or hide categories meta', 'premium-addons-for-elementor' ),
1667 'default' => 'yes',
1668 )
1669 );
1670
1671 $this->add_control(
1672 'premium_blog_comments_meta',
1673 array(
1674 'label' => __( 'Comments Meta', 'premium-addons-for-elementor' ),
1675 'description' => __( 'Display or hide comments meta', 'premium-addons-for-elementor' ),
1676 'type' => Controls_Manager::SWITCHER,
1677 'default' => 'yes',
1678 )
1679 );
1680
1681 $this->add_control(
1682 'premium_blog_tags_meta',
1683 array(
1684 'label' => __( 'Tags Meta', 'premium-addons-for-elementor' ),
1685 'type' => Controls_Manager::SWITCHER,
1686 'description' => __( 'Display or hide post tags', 'premium-addons-for-elementor' ),
1687 )
1688 );
1689
1690 $this->add_responsive_control(
1691 'post_text_align',
1692 array(
1693 'label' => __( 'Alignment', 'premium-addons-for-elementor' ),
1694 'type' => Controls_Manager::CHOOSE,
1695 'options' => array(
1696 'left' => array(
1697 'title' => __( 'Left', 'premium-addons-for-elementor' ),
1698 'icon' => 'eicon-text-align-left',
1699 ),
1700 'center' => array(
1701 'title' => __( 'Center', 'premium-addons-for-elementor' ),
1702 'icon' => 'eicon-text-align-center',
1703 ),
1704 'right' => array(
1705 'title' => __( 'Right', 'premium-addons-for-elementor' ),
1706 'icon' => 'eicon-text-align-right',
1707 ),
1708 'justify' => array(
1709 'title' => __( 'Justify', 'premium-addons-for-elementor' ),
1710 'icon' => 'eicon-text-align-justify',
1711 ),
1712 ),
1713 'toggle' => false,
1714 'default' => 'left',
1715 'prefix_class' => 'premium-blog-align-',
1716 'selectors' => array(
1717 '{{WRAPPER}} .premium-blog-content-wrapper' => 'text-align: {{VALUE}};',
1718 ),
1719 )
1720 );
1721
1722 $this->add_responsive_control(
1723 'post_bottom_spacing',
1724 array(
1725 'label' => __( 'Bottom Spacing', 'premium-addons-for-elementor' ),
1726 'type' => Controls_Manager::SLIDER,
1727 'size_units' => array( 'px', '%', 'em' ),
1728 'range' => array(
1729 'px' => array(
1730 'min' => 1,
1731 'max' => 200,
1732 ),
1733 ),
1734 'default' => array(
1735 'size' => 5,
1736 'unit' => 'px',
1737 ),
1738 'selectors' => array(
1739 '{{WRAPPER}} .premium-blog-post-outer-container' => 'margin-bottom: {{SIZE}}{{UNIT}}',
1740 ),
1741 )
1742 );
1743
1744 $this->end_controls_section();
1745
1746 $this->start_controls_section(
1747 'premium_blog_general_settings',
1748 array(
1749 'label' => __( 'Featured Image', 'premium-addons-for-elementor' ),
1750 )
1751 );
1752
1753 $this->add_control(
1754 'show_featured_image',
1755 array(
1756 'label' => __( 'Show Featured Image', 'premium-addons-for-elementor' ),
1757 'type' => Controls_Manager::SWITCHER,
1758 'default' => 'yes',
1759 'condition' => array(
1760 'premium_blog_skin!' => 'banner',
1761 ),
1762 )
1763 );
1764
1765 $featured_image_conditions = array(
1766 'show_featured_image' => 'yes',
1767 );
1768
1769 $this->add_group_control(
1770 Group_Control_Image_Size::get_type(),
1771 array(
1772 'name' => 'featured_image',
1773 'default' => 'full',
1774 'condition' => $featured_image_conditions,
1775 )
1776 );
1777
1778 $this->add_control(
1779 'premium_blog_hover_color_effect',
1780 array(
1781 'label' => __( 'Overlay Effect', 'premium-addons-for-elementor' ),
1782 'type' => Controls_Manager::SELECT,
1783 'description' => __( 'Choose an overlay color effect', 'premium-addons-for-elementor' ),
1784 'options' => array(
1785 'none' => __( 'None', 'premium-addons-for-elementor' ),
1786 'framed' => __( 'Framed', 'premium-addons-for-elementor' ),
1787 'diagonal' => __( 'Diagonal', 'premium-addons-for-elementor' ),
1788 'bordered' => __( 'Bordered', 'premium-addons-for-elementor' ),
1789 'squares' => __( 'Squares', 'premium-addons-for-elementor' ),
1790 ),
1791 'default' => 'framed',
1792 'label_block' => true,
1793 'condition' => array_merge(
1794 $featured_image_conditions,
1795 array(
1796 'premium_blog_skin' => array( 'modern', 'cards' ),
1797 )
1798 ),
1799 )
1800 );
1801
1802 $this->add_control(
1803 'premium_blog_hover_image_effect',
1804 array(
1805 'label' => __( 'Hover Effect', 'premium-addons-for-elementor' ),
1806 'type' => Controls_Manager::SELECT,
1807 'description' => __( 'Choose a hover effect for the image', 'premium-addons-for-elementor' ),
1808 'options' => array(
1809 'none' => __( 'None', 'premium-addons-for-elementor' ),
1810 'zoomin' => __( 'Zoom In', 'premium-addons-for-elementor' ),
1811 'zoomout' => __( 'Zoom Out', 'premium-addons-for-elementor' ),
1812 'scale' => __( 'Scale', 'premium-addons-for-elementor' ),
1813 'gray' => __( 'Grayscale', 'premium-addons-for-elementor' ),
1814 'blur' => __( 'Blur', 'premium-addons-for-elementor' ),
1815 'bright' => __( 'Bright', 'premium-addons-for-elementor' ),
1816 'sepia' => __( 'Sepia', 'premium-addons-for-elementor' ),
1817 'trans' => __( 'Translate', 'premium-addons-for-elementor' ),
1818 ),
1819 'default' => 'zoomin',
1820 'label_block' => true,
1821 'condition' => $featured_image_conditions,
1822 )
1823 );
1824
1825 $this->add_responsive_control(
1826 'premium_blog_thumb_min_height',
1827 array(
1828 'label' => __( 'Height', 'premium-addons-for-elementor' ),
1829 'type' => Controls_Manager::SLIDER,
1830 'size_units' => array( 'px', 'em', 'custom' ),
1831 'range' => array(
1832 'px' => array(
1833 'min' => 0,
1834 'max' => 600,
1835 ),
1836 'em' => array(
1837 'min' => 1,
1838 'max' => 60,
1839 ),
1840 ),
1841 'condition' => array_merge( $featured_image_conditions ),
1842 'selectors' => array(
1843 '{{WRAPPER}} .premium-blog-thumbnail-container img' => 'height: {{SIZE}}{{UNIT}};',
1844 ),
1845 )
1846 );
1847
1848 $this->add_responsive_control(
1849 'premium_blog_thumbnail_fit',
1850 array(
1851 'label' => __( 'Thumbnail Fit', 'premium-addons-for-elementor' ),
1852 'type' => Controls_Manager::SELECT,
1853 'options' => array(
1854 'cover' => __( 'Cover', 'premium-addons-for-elementor' ),
1855 'fill' => __( 'Fill', 'premium-addons-for-elementor' ),
1856 'contain' => __( 'Contain', 'premium-addons-for-elementor' ),
1857 ),
1858 'default' => 'cover',
1859 'selectors' => array(
1860 '{{WRAPPER}} .premium-blog-thumbnail-container img' => 'object-fit: {{VALUE}}',
1861 ),
1862 'condition' => array_merge( $featured_image_conditions ),
1863 )
1864 );
1865
1866 $this->add_control(
1867 'shape_divider',
1868 array(
1869 'label' => __( 'Shape Divider', 'premium-addons-for-elementor' ),
1870 'type' => Controls_Manager::SELECT,
1871 'options' => array(
1872 'none' => __( 'None', 'premium-addons-for-elementor' ),
1873 'arrow' => __( 'Arrow', 'premium-addons-for-elementor' ),
1874 'book' => __( 'Book', 'premium-addons-for-elementor' ),
1875 'cloud' => __( 'Clouds', 'premium-addons-for-elementor' ),
1876 'curve' => __( 'Curve', 'premium-addons-for-elementor' ),
1877 'curve-asymmetric' => __( 'Curve Asymmetric', 'premium-addons-for-elementor' ),
1878 'drops' => __( 'Drop', 'premium-addons-for-elementor' ),
1879 'fan' => __( 'Fan', 'premium-addons-for-elementor' ),
1880 'mountain' => __( 'Mountains', 'premium-addons-for-elementor' ),
1881 'pyramids' => __( 'Pyramids', 'premium-addons-for-elementor' ),
1882 'split' => __( 'Split', 'premium-addons-for-elementor' ),
1883 'triangle' => __( 'Triangle', 'premium-addons-for-elementor' ),
1884 'tri_asymmetric' => __( 'Asymmetric Triangle', 'premium-addons-for-elementor' ),
1885 'tilt' => __( 'Tilt', 'premium-addons-for-elementor' ),
1886 'tilt-opacity' => __( 'Tilt Opacity', 'premium-addons-for-elementor' ),
1887 'waves' => __( 'Wave', 'premium-addons-for-elementor' ),
1888 'waves-brush' => __( 'Waves Brush', 'premium-addons-for-elementor' ),
1889 'waves-pattern' => __( 'Waves Pattern', 'premium-addons-for-elementor' ),
1890 'zigzag' => __( 'Zigzag', 'premium-addons-for-elementor' ),
1891 ),
1892 'default' => 'none',
1893 'label_block' => true,
1894 'condition' => array(
1895 'show_featured_image' => 'yes',
1896 ),
1897 )
1898 );
1899
1900 $this->end_controls_section();
1901
1902 $this->start_controls_section(
1903 'section_pa_docs',
1904 array(
1905 'label' => __( 'Helpful Documentations', 'premium-addons-for-elementor' ),
1906 )
1907 );
1908
1909 $docs = array(
1910 'https://premiumaddons.com/docs/elementor-recent-posts-notification-widget/' => __( 'Getting started »', 'premium-addons-for-elementor' ),
1911 );
1912
1913 $doc_index = 1;
1914 foreach ( $docs as $url => $title ) {
1915
1916 $doc_url = Helper_Functions::get_campaign_link( $url, 'editor-page', 'wp-editor', 'get-support' );
1917
1918 $this->add_control(
1919 'doc_' . $doc_index,
1920 array(
1921 'type' => Controls_Manager::RAW_HTML,
1922 'raw' => sprintf( '<a href="%s" target="_blank">%s</a>', $doc_url, $title ),
1923 'content_classes' => 'editor-pa-doc',
1924 )
1925 );
1926
1927 ++$doc_index;
1928
1929 }
1930
1931 $this->end_controls_section();
1932
1933 $this->start_controls_section(
1934 'icon_style',
1935 array(
1936 'label' => __( 'Icon Style', 'premium-addons-for-elementor' ),
1937 'tab' => Controls_Manager::TAB_STYLE,
1938 'condition' => array(
1939 'premium_blog_skin!' => $options['skin_condition'],
1940 ),
1941 )
1942 );
1943
1944 $this->add_group_control(
1945 Group_Control_Typography::get_type(),
1946 array(
1947 'name' => 'text_typography',
1948 'selector' => '{{WRAPPER}} .premium-not-icon-text',
1949 'condition' => array(
1950 'icon_type' => 'text',
1951 ),
1952 )
1953 );
1954
1955 $this->start_controls_tabs( 'icon_style_tabs' );
1956
1957 $this->start_controls_tab(
1958 'icon_style_normal',
1959 array(
1960 'label' => __( 'Normal', 'premium-addons-for-elementor' ),
1961 )
1962 );
1963
1964 $this->add_control(
1965 'icon_color',
1966 array(
1967 'label' => __( 'Icon/Text Color', 'premium-addons-for-elementor' ),
1968 'type' => Controls_Manager::COLOR,
1969 'selectors' => array(
1970 '{{WRAPPER}} .pa-rec-not-icon-wrap .premium-drawable-icon *, {{WRAPPER}} .pa-rec-not-icon-wrap svg:not([class*="premium-"])' => 'fill: {{VALUE}};',
1971 '{{WRAPPER}} .premium-not-icon-text' => 'color: {{VALUE}};',
1972 ),
1973 'condition' => array(
1974 'icon_type!' => array( 'image', 'animation' ),
1975 ),
1976 )
1977 );
1978
1979 if ( $draw_icon ) {
1980 $this->add_control(
1981 'stroke_color',
1982 array(
1983 'label' => __( 'Stroke Color', 'premium-addons-for-elementor' ),
1984 'type' => Controls_Manager::COLOR,
1985 'global' => array(
1986 'default' => Global_Colors::COLOR_ACCENT,
1987 ),
1988 'condition' => array(
1989 'icon_type' => array( 'icon', 'svg' ),
1990 ),
1991 'selectors' => array(
1992 '{{WRAPPER}} .pa-rec-not-icon-wrap .premium-drawable-icon *, {{WRAPPER}} .pa-rec-not-icon-wrap svg:not([class*="premium-"])' => 'stroke: {{VALUE}};',
1993 ),
1994 )
1995 );
1996 }
1997
1998 $this->add_control(
1999 'icon_back_color',
2000 array(
2001 'label' => __( 'Background Color', 'premium-addons-for-elementor' ),
2002 'type' => Controls_Manager::COLOR,
2003 'selectors' => array(
2004 '{{WRAPPER}} .pa-rec-not-icon-wrap' => 'background-color: {{VALUE}};',
2005 ),
2006 )
2007 );
2008
2009 $this->add_group_control(
2010 Group_Control_Border::get_type(),
2011 array(
2012 'name' => 'icon_border',
2013 'selector' => '{{WRAPPER}} .pa-rec-not-icon-wrap',
2014 )
2015 );
2016
2017 $this->add_control(
2018 'icon_border_radius',
2019 array(
2020 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ),
2021 'type' => Controls_Manager::SLIDER,
2022 'size_units' => array( 'px', '%', 'em' ),
2023 'selectors' => array(
2024 '{{WRAPPER}} .pa-rec-not-icon-wrap' => 'border-radius: {{SIZE}}{{UNIT}};',
2025 ),
2026 )
2027 );
2028
2029 $this->add_control(
2030 'icon_adv_radius',
2031 array(
2032 'label' => __( 'Advanced Border Radius', 'premium-addons-for-elementor' ),
2033 'type' => Controls_Manager::SWITCHER,
2034 'description' => __( 'Apply custom radius values. Get the radius value from ', 'premium-addons-for-elementor' ) . '<a href="https://9elements.github.io/fancy-border-radius/" target="_blank">here</a>',
2035 )
2036 );
2037
2038 $this->add_control(
2039 'icon_adv_radius_value',
2040 array(
2041 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ),
2042 'type' => Controls_Manager::TEXT,
2043 'dynamic' => array( 'active' => true ),
2044 'selectors' => array(
2045 '{{WRAPPER}} .pa-rec-not-icon-wrap' => 'border-radius: {{VALUE}};',
2046 ),
2047 'condition' => array(
2048 'icon_adv_radius' => 'yes',
2049 ),
2050 )
2051 );
2052
2053 $this->add_group_control(
2054 Group_Control_Text_Shadow::get_type(),
2055 array(
2056 'name' => 'text_shadow_normal',
2057 'selector' => '{{WRAPPER}} .premium-not-icon-text',
2058 'condition' => array(
2059 'icon_type' => 'text',
2060 ),
2061 )
2062 );
2063
2064 $this->add_group_control(
2065 Group_Control_Box_Shadow::get_type(),
2066 array(
2067 'name' => 'box_shadow_normal',
2068 'selector' => '{{WRAPPER}} .pa-rec-not-icon-wrap',
2069 )
2070 );
2071
2072 $this->add_responsive_control(
2073 'icon_margin',
2074 array(
2075 'label' => __( 'Margin', 'premium-addons-for-elementor' ),
2076 'type' => Controls_Manager::DIMENSIONS,
2077 'size_units' => array( 'px', 'em', '%' ),
2078 'selectors' => array(
2079 '{{WRAPPER}} .pa-rec-not-icon-wrap' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2080 ),
2081 )
2082 );
2083
2084 $this->add_responsive_control(
2085 'icon_padding',
2086 array(
2087 'label' => __( 'Padding', 'premium-addons-for-elementor' ),
2088 'type' => Controls_Manager::DIMENSIONS,
2089 'size_units' => array( 'px', 'em', '%' ),
2090 'selectors' => array(
2091 '{{WRAPPER}} .pa-rec-not-icon-wrap' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2092 ),
2093 )
2094 );
2095
2096 $this->end_controls_tab();
2097
2098 $this->start_controls_tab(
2099 'icon_style_hover',
2100 array(
2101 'label' => __( 'Hover', 'premium-addons-for-elementor' ),
2102 )
2103 );
2104
2105 $this->add_control(
2106 'icon_color_hover',
2107 array(
2108 'label' => __( 'Icon/Text Color', 'premium-addons-for-elementor' ),
2109 'type' => Controls_Manager::COLOR,
2110 'selectors' => array(
2111 '{{WRAPPER}} .pa-rec-not-icon-wrap:hover *, {{WRAPPER}} .pa-rec-not-icon-wrap:hover svg:not([class*="premium-"])' => 'fill: {{VALUE}};',
2112 '{{WRAPPER}} .pa-rec-not-icon-wrap:hover .premium-not-icon-text' => 'color: {{VALUE}};',
2113 ),
2114 'condition' => array(
2115 'icon_type!' => array( 'image', 'animation' ),
2116 ),
2117 )
2118 );
2119
2120 if ( $draw_icon ) {
2121 $this->add_control(
2122 'stroke_color_hover',
2123 array(
2124 'label' => __( 'Stroke Color', 'premium-addons-for-elementor' ),
2125 'type' => Controls_Manager::COLOR,
2126 'global' => array(
2127 'default' => Global_Colors::COLOR_ACCENT,
2128 ),
2129 'condition' => array(
2130 'icon_type' => array( 'icon', 'svg' ),
2131 ),
2132 'selectors' => array(
2133 '{{WRAPPER}} .pa-rec-not-icon-wrap:hover .premium-drawable-icon *, {{WRAPPER}} .pa-rec-not-icon-wrap:hover svg:not([class*="premium-"])' => 'stroke: {{VALUE}};',
2134 ),
2135 )
2136 );
2137 }
2138
2139 $this->add_control(
2140 'icon_back_color_hover',
2141 array(
2142 'label' => __( 'Background Color', 'premium-addons-for-elementor' ),
2143 'type' => Controls_Manager::COLOR,
2144 'selectors' => array(
2145 '{{WRAPPER}} .pa-rec-not-icon-wrap:hover' => 'background-color: {{VALUE}};',
2146 ),
2147 )
2148 );
2149
2150 $this->add_group_control(
2151 Group_Control_Border::get_type(),
2152 array(
2153 'name' => 'icon_border_hover',
2154 'selector' => '{{WRAPPER}} .pa-rec-not-icon-wrap:hover',
2155 )
2156 );
2157
2158 $this->add_control(
2159 'icon_border_radius_Hover',
2160 array(
2161 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ),
2162 'type' => Controls_Manager::SLIDER,
2163 'size_units' => array( 'px', '%', 'em' ),
2164 'selectors' => array(
2165 '{{WRAPPER}} .pa-rec-not-icon-wrap:hover' => 'border-radius: {{SIZE}}{{UNIT}};',
2166 ),
2167 )
2168 );
2169
2170 $this->add_control(
2171 'icon_adv_radius_hover',
2172 array(
2173 'label' => __( 'Advanced Border Radius', 'premium-addons-for-elementor' ),
2174 'type' => Controls_Manager::SWITCHER,
2175 'description' => __( 'Apply custom radius values. Get the radius value from ', 'premium-addons-for-elementor' ) . '<a href="https://9elements.github.io/fancy-border-radius/" target="_blank">here</a>',
2176 )
2177 );
2178
2179 $this->add_control(
2180 'icon_adv_radius_value_hover',
2181 array(
2182 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ),
2183 'type' => Controls_Manager::TEXT,
2184 'dynamic' => array( 'active' => true ),
2185 'selectors' => array(
2186 '{{WRAPPER}} .pa-rec-not-icon-wrap:hover' => 'border-radius: {{VALUE}};',
2187 ),
2188 'condition' => array(
2189 'icon_adv_radius_hover' => 'yes',
2190 ),
2191 )
2192 );
2193
2194 $this->add_group_control(
2195 Group_Control_Text_Shadow::get_type(),
2196 array(
2197 'name' => 'text_shadow_hover',
2198 'selector' => '{{WRAPPER}} .pa-rec-not-icon-wrap:hover .premium-not-icon-text',
2199 'condition' => array(
2200 'icon_type' => 'text',
2201 ),
2202 )
2203 );
2204
2205 $this->add_group_control(
2206 Group_Control_Box_Shadow::get_type(),
2207 array(
2208 'name' => 'box_shadow_hover',
2209 'selector' => '{{WRAPPER}} .pa-rec-not-icon-wrap:hover',
2210 )
2211 );
2212
2213 $this->add_responsive_control(
2214 'icon_margin_hover',
2215 array(
2216 'label' => __( 'Margin', 'premium-addons-for-elementor' ),
2217 'type' => Controls_Manager::DIMENSIONS,
2218 'size_units' => array( 'px', 'em', '%' ),
2219 'selectors' => array(
2220 '{{WRAPPER}} .pa-rec-not-icon-wrap:hover' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2221 ),
2222 )
2223 );
2224
2225 $this->add_responsive_control(
2226 'icon_padding_hover',
2227 array(
2228 'label' => __( 'Padding', 'premium-addons-for-elementor' ),
2229 'type' => Controls_Manager::DIMENSIONS,
2230 'size_units' => array( 'px', 'em', '%' ),
2231 'selectors' => array(
2232 '{{WRAPPER}} .pa-rec-not-icon-wrap:hover' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2233 ),
2234 )
2235 );
2236
2237 $this->end_controls_tab();
2238
2239 $this->end_controls_tabs();
2240
2241 $this->end_controls_section();
2242
2243 $this->start_controls_section(
2244 'number_style',
2245 array(
2246 'label' => __( 'Number Style', 'premium-addons-for-elementor' ),
2247 'tab' => Controls_Manager::TAB_STYLE,
2248 'condition' => array(
2249 'premium_blog_skin!' => $options['skin_condition'],
2250 ),
2251 )
2252 );
2253
2254 $this->add_group_control(
2255 Group_Control_Typography::get_type(),
2256 array(
2257 'name' => 'number_typography',
2258 'selector' => '{{WRAPPER}} .pa-rec-not-number span',
2259 )
2260 );
2261
2262 $this->start_controls_tabs( 'number_style_tabs' );
2263
2264 $this->start_controls_tab(
2265 'number_style_normal',
2266 array(
2267 'label' => __( 'Normal', 'premium-addons-for-elementor' ),
2268 )
2269 );
2270
2271 $this->add_control(
2272 'number_color',
2273 array(
2274 'label' => __( 'Color', 'premium-addons-for-elementor' ),
2275 'type' => Controls_Manager::COLOR,
2276 'selectors' => array(
2277 '{{WRAPPER}} .pa-rec-not-number' => 'color: {{VALUE}};',
2278 ),
2279 )
2280 );
2281
2282 $this->add_control(
2283 'number_back_color',
2284 array(
2285 'label' => __( 'Background Color', 'premium-addons-for-elementor' ),
2286 'type' => Controls_Manager::COLOR,
2287 'selectors' => array(
2288 '{{WRAPPER}} .pa-rec-not-number' => 'background-color: {{VALUE}};',
2289 ),
2290 )
2291 );
2292
2293 $this->add_group_control(
2294 Group_Control_Border::get_type(),
2295 array(
2296 'name' => 'number_border',
2297 'selector' => '{{WRAPPER}} .pa-rec-not-number',
2298 )
2299 );
2300
2301 $this->add_control(
2302 'number_border_radius',
2303 array(
2304 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ),
2305 'type' => Controls_Manager::SLIDER,
2306 'size_units' => array( 'px', '%', 'em' ),
2307 'selectors' => array(
2308 '{{WRAPPER}} .pa-rec-not-number' => 'border-radius: {{SIZE}}{{UNIT}};',
2309 ),
2310 )
2311 );
2312
2313 $this->add_control(
2314 'number_adv_radius',
2315 array(
2316 'label' => __( 'Advanced Border Radius', 'premium-addons-for-elementor' ),
2317 'type' => Controls_Manager::SWITCHER,
2318 'description' => __( 'Apply custom radius values. Get the radius value from ', 'premium-addons-for-elementor' ) . '<a href="https://9elements.github.io/fancy-border-radius/" target="_blank">here</a>',
2319 )
2320 );
2321
2322 $this->add_control(
2323 'number_adv_radius_value',
2324 array(
2325 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ),
2326 'type' => Controls_Manager::TEXT,
2327 'dynamic' => array( 'active' => true ),
2328 'selectors' => array(
2329 '{{WRAPPER}} .pa-rec-not-number' => 'border-radius: {{VALUE}};',
2330 ),
2331 'condition' => array(
2332 'number_adv_radius' => 'yes',
2333 ),
2334 )
2335 );
2336
2337 $this->add_group_control(
2338 Group_Control_Text_Shadow::get_type(),
2339 array(
2340 'name' => 'number_shadow_normal',
2341 'selector' => '{{WRAPPER}} .pa-rec-not-number',
2342 )
2343 );
2344
2345 $this->add_group_control(
2346 Group_Control_Box_Shadow::get_type(),
2347 array(
2348 'name' => 'number_box_shadow_normal',
2349 'selector' => '{{WRAPPER}} .pa-rec-not-number',
2350 )
2351 );
2352
2353 $this->add_responsive_control(
2354 'number_margin',
2355 array(
2356 'label' => __( 'Margin', 'premium-addons-for-elementor' ),
2357 'type' => Controls_Manager::DIMENSIONS,
2358 'size_units' => array( 'px', 'em', '%' ),
2359 'selectors' => array(
2360 '{{WRAPPER}} .pa-rec-not-number' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2361 ),
2362 )
2363 );
2364
2365 $this->add_responsive_control(
2366 'number_padding',
2367 array(
2368 'label' => __( 'Padding', 'premium-addons-for-elementor' ),
2369 'type' => Controls_Manager::DIMENSIONS,
2370 'size_units' => array( 'px', 'em', '%' ),
2371 'selectors' => array(
2372 '{{WRAPPER}} .pa-rec-not-number' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2373 ),
2374 )
2375 );
2376
2377 $this->end_controls_tab();
2378
2379 $this->start_controls_tab(
2380 'number_style_hover',
2381 array(
2382 'label' => __( 'Hover', 'premium-addons-for-elementor' ),
2383 )
2384 );
2385
2386 $this->add_control(
2387 'number_color_hover',
2388 array(
2389 'label' => __( 'Color', 'premium-addons-for-elementor' ),
2390 'type' => Controls_Manager::COLOR,
2391 'selectors' => array(
2392 '{{WRAPPER}} .pa-rec-not-icon-wrap:hover .pa-rec-not-number' => 'color: {{VALUE}};',
2393 ),
2394 )
2395 );
2396
2397 $this->add_control(
2398 'number_back_color_hover',
2399 array(
2400 'label' => __( 'Background Color', 'premium-addons-for-elementor' ),
2401 'type' => Controls_Manager::COLOR,
2402 'selectors' => array(
2403 '{{WRAPPER}} .pa-rec-not-icon-wrap:hover .pa-rec-not-number' => 'background-color: {{VALUE}};',
2404 ),
2405 )
2406 );
2407
2408 $this->add_group_control(
2409 Group_Control_Border::get_type(),
2410 array(
2411 'name' => 'number_border_hover',
2412 'selector' => '{{WRAPPER}} .pa-rec-not-icon-wrap:hover .pa-rec-not-number',
2413 )
2414 );
2415
2416 $this->add_control(
2417 'number_border_radius_Hover',
2418 array(
2419 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ),
2420 'type' => Controls_Manager::SLIDER,
2421 'size_units' => array( 'px', '%', 'em' ),
2422 'selectors' => array(
2423 '{{WRAPPER}} .pa-rec-not-icon-wrap:hover .pa-rec-not-number' => 'border-radius: {{SIZE}}{{UNIT}};',
2424 ),
2425 )
2426 );
2427
2428 $this->add_control(
2429 'number_adv_radius_hover',
2430 array(
2431 'label' => __( 'Advanced Border Radius', 'premium-addons-for-elementor' ),
2432 'type' => Controls_Manager::SWITCHER,
2433 'description' => __( 'Apply custom radius values. Get the radius value from ', 'premium-addons-for-elementor' ) . '<a href="https://9elements.github.io/fancy-border-radius/" target="_blank">here</a>',
2434 )
2435 );
2436
2437 $this->add_control(
2438 'number_adv_radius_value_hover',
2439 array(
2440 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ),
2441 'type' => Controls_Manager::TEXT,
2442 'dynamic' => array( 'active' => true ),
2443 'selectors' => array(
2444 '{{WRAPPER}} .pa-rec-not-icon-wrap:hover .pa-rec-not-number' => 'border-radius: {{VALUE}};',
2445 ),
2446 'condition' => array(
2447 'number_adv_radius_hover' => 'yes',
2448 ),
2449 )
2450 );
2451
2452 $this->add_group_control(
2453 Group_Control_Text_Shadow::get_type(),
2454 array(
2455 'name' => 'number_shadow_hover',
2456 'selector' => '{{WRAPPER}} .pa-rec-not-icon-wrap:hover .pa-rec-not-number',
2457 )
2458 );
2459
2460 $this->add_group_control(
2461 Group_Control_Box_Shadow::get_type(),
2462 array(
2463 'name' => 'number_box_shadow_hover',
2464 'selector' => '{{WRAPPER}} .pa-rec-not-icon-wrap:hover .pa-rec-not-number',
2465 )
2466 );
2467
2468 $this->add_responsive_control(
2469 'number_margin_hover',
2470 array(
2471 'label' => __( 'Margin', 'premium-addons-for-elementor' ),
2472 'type' => Controls_Manager::DIMENSIONS,
2473 'size_units' => array( 'px', 'em', '%' ),
2474 'selectors' => array(
2475 '{{WRAPPER}} .pa-rec-not-icon-wrap:hover .pa-rec-not-number' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2476 ),
2477 )
2478 );
2479
2480 $this->add_responsive_control(
2481 'number_padding_hover',
2482 array(
2483 'label' => __( 'Padding', 'premium-addons-for-elementor' ),
2484 'type' => Controls_Manager::DIMENSIONS,
2485 'size_units' => array( 'px', 'em', '%' ),
2486 'selectors' => array(
2487 '{{WRAPPER}} .pa-rec-not-icon-wrap:hover .pa-rec-not-number' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2488 ),
2489 )
2490 );
2491
2492 $this->end_controls_tab();
2493
2494 $this->end_controls_tabs();
2495
2496 $this->end_controls_section();
2497
2498 $this->start_controls_section(
2499 'posts_box_style',
2500 array(
2501 'label' => __( 'Posts Box Style', 'premium-addons-for-elementor' ),
2502 'tab' => Controls_Manager::TAB_STYLE,
2503 'condition' => array(
2504 'premium_blog_skin!' => $options['skin_condition'],
2505 ),
2506 )
2507 );
2508
2509 $this->add_control(
2510 'overlay_color',
2511 array(
2512 'label' => __( 'Overlay Color', 'premium-addons-for-elementor' ),
2513 'type' => Controls_Manager::COLOR,
2514 'selectors' => array(
2515 '{{WRAPPER}} .pa-rec-posts-overlay' => 'background-color: {{VALUE}};',
2516 ),
2517 'condition' => array(
2518 'overlay' => 'yes',
2519 ),
2520 )
2521 );
2522
2523 $this->add_control(
2524 'posts_box_back',
2525 array(
2526 'label' => __( 'Background Color', 'premium-addons-for-elementor' ),
2527 'type' => Controls_Manager::COLOR,
2528 'selectors' => array(
2529 '{{WRAPPER}} .pa-rec-posts-container' => 'background-color: {{VALUE}};',
2530 ),
2531 )
2532 );
2533
2534 $this->add_group_control(
2535 Group_Control_Box_Shadow::get_type(),
2536 array(
2537 'name' => 'posts_box_shadow',
2538 'selector' => '{{WRAPPER}} .pa-rec-posts-container',
2539 )
2540 );
2541
2542 $this->add_group_control(
2543 Group_Control_Border::get_type(),
2544 array(
2545 'name' => 'posts_box_border',
2546 'selector' => '{{WRAPPER}} .pa-rec-posts-container',
2547 )
2548 );
2549
2550 $this->add_control(
2551 'posts_box_border_radius',
2552 array(
2553 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ),
2554 'type' => Controls_Manager::SLIDER,
2555 'size_units' => array( 'px', '%', 'em' ),
2556 'selectors' => array(
2557 '{{WRAPPER}} .pa-rec-posts-container' => 'border-radius: {{SIZE}}{{UNIT}};',
2558 ),
2559 )
2560 );
2561
2562 $this->add_responsive_control(
2563 'posts_box_padding',
2564 array(
2565 'label' => __( 'Padding', 'premium-addons-for-elementor' ),
2566 'type' => Controls_Manager::DIMENSIONS,
2567 'size_units' => array( 'px', 'em', '%' ),
2568 'selectors' => array(
2569 '{{WRAPPER}} .pa-rec-posts-container' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2570 ),
2571 )
2572 );
2573
2574 $this->end_controls_section();
2575
2576 $this->start_controls_section(
2577 'header_style',
2578 array(
2579 'label' => __( 'Header Style', 'premium-addons-for-elementor' ),
2580 'tab' => Controls_Manager::TAB_STYLE,
2581 'condition' => array(
2582 'premium_blog_skin!' => $options['skin_condition'],
2583 ),
2584 )
2585 );
2586
2587 $this->start_controls_tabs( 'header_style_tabs' );
2588
2589 $this->start_controls_tab(
2590 'header_title_tab',
2591 array(
2592 'label' => __( 'Title', 'premium-addons-for-elementor' ),
2593 )
2594 );
2595
2596 $this->add_control(
2597 'header_title_color',
2598 array(
2599 'label' => __( 'Color', 'premium-addons-for-elementor' ),
2600 'type' => Controls_Manager::COLOR,
2601 'selectors' => array(
2602 '{{WRAPPER}} .pa-rec-title' => 'color: {{VALUE}};',
2603 ),
2604 )
2605 );
2606
2607 $this->add_control(
2608 'header_icon_color',
2609 array(
2610 'label' => __( 'Icon Color', 'premium-addons-for-elementor' ),
2611 'type' => Controls_Manager::COLOR,
2612 'selectors' => array(
2613 '{{WRAPPER}} .pa-rec-title-icon-wrap .premium-drawable-icon *, {{WRAPPER}} .pa-rec-title-icon-wrap svg:not([class*="premium-"])' => 'fill: {{VALUE}};',
2614 ),
2615 'condition' => array(
2616 'header_icon_sw' => 'yes',
2617 'header_icon_type!' => array( 'image', 'animation' ),
2618 ),
2619 )
2620 );
2621
2622 if ( $draw_icon ) {
2623 $this->add_control(
2624 'header_stroke_color',
2625 array(
2626 'label' => __( 'Stroke Color', 'premium-addons-for-elementor' ),
2627 'type' => Controls_Manager::COLOR,
2628 'global' => array(
2629 'default' => Global_Colors::COLOR_ACCENT,
2630 ),
2631 'condition' => array(
2632 'header_icon_sw' => 'yes',
2633 'header_icon_type' => array( 'icon', 'svg' ),
2634 ),
2635 'selectors' => array(
2636 '{{WRAPPER}} .pa-rec-title-icon-wrap .premium-drawable-icon *, {{WRAPPER}} .pa-rec-title-icon-wrap svg:not([class*="premium-"])' => 'stroke: {{VALUE}};',
2637 ),
2638 )
2639 );
2640 }
2641
2642 $this->add_group_control(
2643 Group_Control_Typography::get_type(),
2644 array(
2645 'name' => 'header_title_typography',
2646 'selector' => '{{WRAPPER}} .pa-rec-title',
2647 )
2648 );
2649
2650 $this->add_group_control(
2651 Group_Control_Text_Shadow::get_type(),
2652 array(
2653 'name' => 'header_title_shadow',
2654 'selector' => '{{WRAPPER}} .pa-rec-title',
2655 )
2656 );
2657
2658 $this->add_responsive_control(
2659 'header_title_margin',
2660 array(
2661 'label' => __( 'Margin', 'premium-addons-for-elementor' ),
2662 'type' => Controls_Manager::DIMENSIONS,
2663 'size_units' => array( 'px', 'em', '%' ),
2664 'selectors' => array(
2665 '{{WRAPPER}} .pa-rec-title' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2666 ),
2667 )
2668 );
2669
2670 $this->end_controls_tab();
2671
2672 $this->start_controls_tab(
2673 'close_icon_tab',
2674 array(
2675 'label' => __( 'Close Icon', 'premium-addons-for-elementor' ),
2676 )
2677 );
2678
2679 $this->add_control(
2680 'close_icon_size',
2681 array(
2682 'label' => __( 'Size', 'premium-addons-for-elementor' ),
2683 'type' => Controls_Manager::SLIDER,
2684 'size_units' => array( 'px', '%', 'em' ),
2685 'selectors' => array(
2686 '{{WRAPPER}} .pa-rec-posts-close-icon' => 'font-size: {{SIZE}}{{UNIT}}; width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};',
2687 // '{{WRAPPER}} .pa-rec-posts-close' => '',
2688 ),
2689 )
2690 );
2691
2692 $this->add_control(
2693 'close_icon_color',
2694 array(
2695 'label' => __( 'Color', 'premium-addons-for-elementor' ),
2696 'type' => Controls_Manager::COLOR,
2697 'selectors' => array(
2698 '{{WRAPPER}} .pa-rec-posts-close-icon' => 'color: {{VALUE}};',
2699 ),
2700 )
2701 );
2702
2703 $this->add_control(
2704 'close_icon_backcolor',
2705 array(
2706 'label' => __( 'Background Color', 'premium-addons-for-elementor' ),
2707 'type' => Controls_Manager::COLOR,
2708 'selectors' => array(
2709 '{{WRAPPER}} .pa-rec-posts-close' => 'background-color: {{VALUE}};',
2710 ),
2711 )
2712 );
2713
2714 $this->add_group_control(
2715 Group_Control_Text_Shadow::get_type(),
2716 array(
2717 'label' => __( 'Shadow', 'premium-addons-for-elementor' ),
2718 'name' => 'close_icon_shadow',
2719 'selector' => '{{WRAPPER}} .pa-rec-posts-close-icon',
2720 )
2721 );
2722
2723 $this->add_group_control(
2724 Group_Control_Border::get_type(),
2725 array(
2726 'name' => 'close_icon_border',
2727 'selector' => '{{WRAPPER}} .pa-rec-posts-close',
2728 )
2729 );
2730
2731 $this->add_control(
2732 'close_icon_border_radius',
2733 array(
2734 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ),
2735 'type' => Controls_Manager::SLIDER,
2736 'size_units' => array( 'px', '%', 'em' ),
2737 'selectors' => array(
2738 '{{WRAPPER}} .pa-rec-posts-close' => 'border-radius: {{SIZE}}{{UNIT}};',
2739 ),
2740 )
2741 );
2742
2743 $this->add_responsive_control(
2744 'close_icon_margin',
2745 array(
2746 'label' => __( 'Margin', 'premium-addons-for-elementor' ),
2747 'type' => Controls_Manager::DIMENSIONS,
2748 'size_units' => array( 'px', 'em', '%' ),
2749 'selectors' => array(
2750 '{{WRAPPER}} .pa-rec-posts-close' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2751 ),
2752 )
2753 );
2754
2755 $this->add_responsive_control(
2756 'close_icon_padding',
2757 array(
2758 'label' => __( 'Padding', 'premium-addons-for-elementor' ),
2759 'type' => Controls_Manager::DIMENSIONS,
2760 'size_units' => array( 'px', 'em', '%' ),
2761 'selectors' => array(
2762 '{{WRAPPER}} .pa-rec-posts-close' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2763 ),
2764 )
2765 );
2766
2767 $this->end_controls_tab();
2768
2769 $this->end_controls_tabs();
2770
2771 $this->add_control(
2772 'header_back',
2773 array(
2774 'label' => __( 'Background Color', 'premium-addons-for-elementor' ),
2775 'type' => Controls_Manager::COLOR,
2776 'separator' => 'before',
2777 'selectors' => array(
2778 '{{WRAPPER}} .pa-rec-posts-header' => 'background-color: {{VALUE}};',
2779 ),
2780 )
2781 );
2782
2783 $this->add_group_control(
2784 Group_Control_Border::get_type(),
2785 array(
2786 'name' => 'header_border',
2787 'selector' => '{{WRAPPER}} .pa-rec-posts-header',
2788 )
2789 );
2790
2791 $this->add_control(
2792 'header_border_radius',
2793 array(
2794 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ),
2795 'type' => Controls_Manager::SLIDER,
2796 'size_units' => array( 'px', '%', 'em' ),
2797 'selectors' => array(
2798 '{{WRAPPER}} .pa-rec-posts-header' => 'border-radius: {{SIZE}}{{UNIT}};',
2799 ),
2800 )
2801 );
2802
2803 $this->add_responsive_control(
2804 'header_margin',
2805 array(
2806 'label' => __( 'Margin', 'premium-addons-for-elementor' ),
2807 'type' => Controls_Manager::DIMENSIONS,
2808 'size_units' => array( 'px', 'em', '%' ),
2809 'selectors' => array(
2810 '{{WRAPPER}} .pa-rec-posts-header' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2811 ),
2812 )
2813 );
2814
2815 $this->add_responsive_control(
2816 'header_padding',
2817 array(
2818 'label' => __( 'Padding', 'premium-addons-for-elementor' ),
2819 'type' => Controls_Manager::DIMENSIONS,
2820 'size_units' => array( 'px', 'em', '%' ),
2821 'selectors' => array(
2822 '{{WRAPPER}} .pa-rec-posts-header' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2823 ),
2824 )
2825 );
2826
2827 $this->end_controls_section();
2828
2829 $this->start_controls_section(
2830 'image_style_section',
2831 array(
2832 'label' => __( 'Post Image', 'premium-addons-for-elementor' ),
2833 'tab' => Controls_Manager::TAB_STYLE,
2834 'condition' => array(
2835 'show_featured_image' => 'yes',
2836 'premium_blog_skin!' => $options['skin_condition'],
2837 ),
2838 )
2839 );
2840
2841 $this->add_control(
2842 'plus_color',
2843 array(
2844 'label' => __( 'Plus Sign Color', 'premium-addons-for-elementor' ),
2845 'type' => Controls_Manager::COLOR,
2846 'selectors' => array(
2847 '{{WRAPPER}} .premium-blog-thumbnail-container:before, {{WRAPPER}} .premium-blog-thumbnail-container:after' => 'background-color: {{VALUE}} !important',
2848 ),
2849 'condition' => array(
2850 'premium_blog_skin' => array( 'modern', 'cards' ),
2851 ),
2852 )
2853 );
2854
2855 $this->add_control(
2856 'thumbnail_overlay_color',
2857 array(
2858 'label' => __( 'Overlay Color', 'premium-addons-for-elementor' ),
2859 'type' => Controls_Manager::COLOR,
2860 'selectors' => array(
2861 '{{WRAPPER}} .premium-blog-framed-effect, {{WRAPPER}} .premium-blog-bordered-effect,{{WRAPPER}} .premium-blog-squares-effect:before, {{WRAPPER}} .premium-blog-squares-effect:after, {{WRAPPER}} .premium-blog-squares-square-container:before, {{WRAPPER}} .premium-blog-squares-square-container:after, {{WRAPPER}} .premium-blog-thumbnail-overlay' => 'background-color: {{VALUE}};',
2862 ),
2863 )
2864 );
2865
2866 $this->add_control(
2867 'border_effect_color',
2868 array(
2869 'label' => __( 'Border Color', 'premium-addons-for-elementor' ),
2870 'type' => Controls_Manager::COLOR,
2871 'global' => array(
2872 'default' => Global_Colors::COLOR_SECONDARY,
2873 ),
2874 'condition' => array(
2875 'premium_blog_hover_color_effect' => 'bordered',
2876 ),
2877 'selectors' => array(
2878 '{{WRAPPER}} .premium-blog-post-link:before, {{WRAPPER}} .premium-blog-post-link:after' => 'border-color: {{VALUE}};',
2879 ),
2880 )
2881 );
2882
2883 $this->add_group_control(
2884 Group_Control_Css_Filter::get_type(),
2885 array(
2886 'name' => 'css_filters',
2887 'selector' => '{{WRAPPER}} .premium-blog-thumbnail-container img',
2888 )
2889 );
2890
2891 $this->add_group_control(
2892 Group_Control_Css_Filter::get_type(),
2893 array(
2894 'name' => 'hover_css_filters',
2895 'label' => __( 'Hover CSS Filters', 'premium-addons-for-elementor' ),
2896 'selector' => '{{WRAPPER}} .premium-blog-post-container:hover .premium-blog-thumbnail-container img',
2897 )
2898 );
2899
2900 $this->add_control(
2901 'divider_heading',
2902 array(
2903 'label' => __( 'Shape Divider', 'premium-addons-for-elementor' ),
2904 'type' => Controls_Manager::HEADING,
2905 'separator' => 'before',
2906 'condition' => array(
2907 'show_featured_image' => 'yes',
2908 'shape_divider!' => 'none',
2909 ),
2910 )
2911 );
2912
2913 $this->add_control(
2914 'divider_fill_color',
2915 array(
2916 'label' => __( 'Color', 'premium-addons-for-elementor' ),
2917 'type' => Controls_Manager::COLOR,
2918 'selectors' => array(
2919 '{{WRAPPER}} .premium-blog-masked .premium-blog-thumbnail-container svg' => 'fill: {{VALUE}}',
2920 ),
2921 'condition' => array(
2922 'show_featured_image' => 'yes',
2923 'shape_divider!' => 'none',
2924 ),
2925 )
2926 );
2927
2928 $this->add_responsive_control(
2929 'divider_width',
2930 array(
2931 'label' => __( 'Width', 'premium-addons-for-elementor' ),
2932 'type' => Controls_Manager::SLIDER,
2933 'size_units' => array( 'px', 'em', '%' ),
2934 'range' => array(
2935 'px' => array(
2936 'min' => 0,
2937 'max' => 1000,
2938 ),
2939 ),
2940 'selectors' => array(
2941 '{{WRAPPER}} .premium-blog-masked .premium-blog-thumbnail-container svg' => 'width: {{SIZE}}{{UNIT}}',
2942 ),
2943 'condition' => array(
2944 'show_featured_image' => 'yes',
2945 'shape_divider!' => 'none',
2946 ),
2947 )
2948 );
2949
2950 $this->add_responsive_control(
2951 'divider_height',
2952 array(
2953 'label' => __( 'Height', 'premium-addons-for-elementor' ),
2954 'type' => Controls_Manager::SLIDER,
2955 'size_units' => array( 'px', 'em', '%' ),
2956 'range' => array(
2957 'px' => array(
2958 'min' => 0,
2959 'max' => 300,
2960 ),
2961 ),
2962 'selectors' => array(
2963 '{{WRAPPER}} .premium-blog-masked .premium-blog-thumbnail-container svg' => 'height: {{SIZE}}{{UNIT}}',
2964 ),
2965 'condition' => array(
2966 'show_featured_image' => 'yes',
2967 'shape_divider!' => 'none',
2968 ),
2969 )
2970 );
2971
2972 $is_rtl = is_rtl() ? 'right' : 'left';
2973
2974 $this->add_responsive_control(
2975 'divider_horizontal',
2976 array(
2977 'label' => __( 'Horizontal Postion', 'premium-addons-for-elementor' ),
2978 'type' => Controls_Manager::SLIDER,
2979 'size_units' => array( 'px', 'em', '%' ),
2980 'range' => array(
2981 'px' => array(
2982 'min' => 0,
2983 'max' => 300,
2984 ),
2985 ),
2986 'selectors' => array(
2987 '{{WRAPPER}} .premium-blog-masked .premium-blog-thumbnail-container svg' => $is_rtl . ': {{SIZE}}{{UNIT}}',
2988 ),
2989 'condition' => array(
2990 'show_featured_image' => 'yes',
2991 'shape_divider!' => 'none',
2992 ),
2993 )
2994 );
2995
2996 $this->add_responsive_control(
2997 'divider_vertical',
2998 array(
2999 'label' => __( 'Vertical Postion', 'premium-addons-for-elementor' ),
3000 'type' => Controls_Manager::SLIDER,
3001 'size_units' => array( 'px', 'em', '%' ),
3002 'range' => array(
3003 'px' => array(
3004 'min' => -50,
3005 'max' => 300,
3006 ),
3007 ),
3008 'selectors' => array(
3009 '{{WRAPPER}} .premium-blog-masked .premium-blog-thumbnail-container svg' => 'bottom: {{SIZE}}{{UNIT}}',
3010 ),
3011 'condition' => array(
3012 'show_featured_image' => 'yes',
3013 'shape_divider!' => 'none',
3014 ),
3015 )
3016 );
3017
3018 $this->end_controls_section();
3019
3020 $this->start_controls_section(
3021 'post_title_style',
3022 array(
3023 'label' => __( 'Title', 'premium-addons-for-elementor' ),
3024 'tab' => Controls_Manager::TAB_STYLE,
3025 'condition' => array(
3026 'premium_blog_skin!' => $options['skin_condition'],
3027 ),
3028 )
3029 );
3030
3031 $this->add_group_control(
3032 Group_Control_Typography::get_type(),
3033 array(
3034 'name' => 'post_title_typo',
3035 'global' => array(
3036 'default' => Global_Typography::TYPOGRAPHY_PRIMARY,
3037 ),
3038 'selector' => '{{WRAPPER}} .premium-blog-entry-title, {{WRAPPER}} .premium-blog-entry-title a',
3039 )
3040 );
3041
3042 $this->add_control(
3043 'post_title_color',
3044 array(
3045 'label' => __( 'Color', 'premium-addons-for-elementor' ),
3046 'type' => Controls_Manager::COLOR,
3047 'global' => array(
3048 'default' => Global_Colors::COLOR_SECONDARY,
3049 ),
3050 'selectors' => array(
3051 '{{WRAPPER}} .premium-blog-entry-title a' => 'color: {{VALUE}};',
3052 ),
3053 )
3054 );
3055
3056 $this->add_control(
3057 'post_title_hover_color',
3058 array(
3059 'label' => __( 'Hover Color', 'premium-addons-for-elementor' ),
3060 'type' => Controls_Manager::COLOR,
3061 'global' => array(
3062 'default' => Global_Colors::COLOR_PRIMARY,
3063 ),
3064 'selectors' => array(
3065 '{{WRAPPER}} .premium-blog-entry-title:hover a' => 'color: {{VALUE}};',
3066 ),
3067 )
3068 );
3069
3070 $this->add_responsive_control(
3071 'post_title_spacing',
3072 array(
3073 'label' => __( 'Bottom Spacing', 'premium-addons-for-elementor' ),
3074 'type' => Controls_Manager::SLIDER,
3075 'size_units' => array( 'px', 'em', '%' ),
3076 'selectors' => array(
3077 '{{WRAPPER}} .premium-blog-entry-title' => 'margin-bottom: {{SIZE}}{{UNIT}}',
3078 ),
3079 )
3080 );
3081
3082 $this->end_controls_section();
3083
3084 if ( $papro_activated ) {
3085 do_action( 'pa_notification_cats_controls', $this );
3086 }
3087
3088 $this->start_controls_section(
3089 'meta_style_section',
3090 array(
3091 'label' => __( 'Metadata', 'premium-addons-for-elementor' ),
3092 'tab' => Controls_Manager::TAB_STYLE,
3093 'condition' => array(
3094 'premium_blog_skin!' => $options['skin_condition'],
3095 ),
3096 )
3097 );
3098
3099 $this->add_group_control(
3100 Group_Control_Typography::get_type(),
3101 array(
3102 'name' => 'meta_typo',
3103 'global' => array(
3104 'default' => Global_Typography::TYPOGRAPHY_SECONDARY,
3105 ),
3106 'selector' => '{{WRAPPER}} .premium-blog-meta-data',
3107 )
3108 );
3109
3110 $this->add_control(
3111 'meta_color',
3112 array(
3113 'label' => __( 'Metadata Color', 'premium-addons-for-elementor' ),
3114 'type' => Controls_Manager::COLOR,
3115 'selectors' => array(
3116 '{{WRAPPER}} .premium-blog-meta-data > *' => 'color: {{VALUE}}',
3117 ),
3118 )
3119 );
3120
3121 $this->add_control(
3122 'meta_hover_color',
3123 array(
3124 'label' => __( 'Links Hover Color', 'premium-addons-for-elementor' ),
3125 'type' => Controls_Manager::COLOR,
3126 'selectors' => array(
3127 '{{WRAPPER}} .premium-blog-meta-data:not(.premium-blog-post-time):hover > *' => 'color: {{VALUE}}',
3128 ),
3129 )
3130 );
3131
3132 $this->add_control(
3133 'separator_color',
3134 array(
3135 'label' => __( 'Separator Color', 'premium-addons-for-elementor' ),
3136 'type' => Controls_Manager::COLOR,
3137 'separator' => 'before',
3138 'selectors' => array(
3139 '{{WRAPPER}} .premium-blog-meta-separator' => 'color: {{VALUE}}',
3140 ),
3141 )
3142 );
3143
3144 $this->end_controls_section();
3145
3146 $this->start_controls_section(
3147 'premium_blog_content_style_section',
3148 array(
3149 'label' => __( 'Content Box', 'premium-addons-for-elementor' ),
3150 'tab' => Controls_Manager::TAB_STYLE,
3151 'condition' => array(
3152 'premium_blog_skin!' => $options['skin_condition'],
3153 ),
3154 )
3155 );
3156
3157 $this->add_group_control(
3158 Group_Control_Typography::get_type(),
3159 array(
3160 'name' => 'post_content_typo',
3161 'selector' => '{{WRAPPER}} .premium-blog-post-content',
3162 'condition' => array(
3163 'content_source' => 'excerpt',
3164 ),
3165 )
3166 );
3167
3168 $this->add_control(
3169 'post_content_color',
3170 array(
3171 'label' => __( 'Text Color', 'premium-addons-for-elementor' ),
3172 'type' => Controls_Manager::COLOR,
3173 'global' => array(
3174 'default' => Global_Colors::COLOR_TEXT,
3175 ),
3176 'selectors' => array(
3177 '{{WRAPPER}} .premium-blog-post-content' => 'color: {{VALUE}};',
3178 ),
3179 'condition' => array(
3180 'content_source' => 'excerpt',
3181 ),
3182 )
3183 );
3184
3185 $this->add_responsive_control(
3186 'excerpt_text_margin',
3187 array(
3188 'label' => __( 'Text Margin', 'premium-addons-for-elementor' ),
3189 'type' => Controls_Manager::DIMENSIONS,
3190 'size_units' => array( 'px', 'em', '%' ),
3191 'selectors' => array(
3192 '{{WRAPPER}} .premium-blog-post-content' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
3193 ),
3194 'condition' => array(
3195 'content_source' => 'excerpt',
3196 ),
3197 )
3198 );
3199
3200 $this->add_control(
3201 'post_background_color',
3202 array(
3203 'label' => __( 'Background Color', 'premium-addons-for-elementor' ),
3204 'type' => Controls_Manager::COLOR,
3205 'separator' => 'before',
3206 'selectors' => array(
3207 '{{WRAPPER}} .premium-blog-content-wrapper' => 'background-color: {{VALUE}};',
3208 ),
3209 'condition' => array(
3210 'premium_blog_skin!' => 'banner',
3211 ),
3212 )
3213 );
3214
3215 $this->add_group_control(
3216 Group_Control_Background::get_type(),
3217 array(
3218 'name' => 'post_background_color',
3219 'types' => array( 'classic', 'gradient' ),
3220 'selector' => '{{WRAPPER}} .premium-blog-content-wrapper',
3221 'condition' => array(
3222 'premium_blog_skin' => 'banner',
3223 ),
3224 )
3225 );
3226
3227 $this->add_group_control(
3228 Group_Control_Box_Shadow::get_type(),
3229 array(
3230 'name' => 'post_box_shadow',
3231 'selector' => '{{WRAPPER}} .premium-blog-content-wrapper',
3232 )
3233 );
3234
3235 $this->add_responsive_control(
3236 'post_content_margin',
3237 array(
3238 'label' => __( 'Margin', 'premium-addons-for-elementor' ),
3239 'type' => Controls_Manager::DIMENSIONS,
3240 'size_units' => array( 'px', 'em', '%' ),
3241 'selectors' => array(
3242 '{{WRAPPER}} .premium-blog-content-wrapper' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
3243 ),
3244 )
3245 );
3246
3247 $this->add_responsive_control(
3248 'post_content_padding',
3249 array(
3250 'label' => __( 'Padding', 'premium-addons-for-elementor' ),
3251 'type' => Controls_Manager::DIMENSIONS,
3252 'size_units' => array( 'px', 'em', '%' ),
3253 'selectors' => array(
3254 '{{WRAPPER}} .premium-blog-content-wrapper' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
3255 ),
3256 )
3257 );
3258
3259 $this->end_controls_section();
3260
3261 $this->start_controls_section(
3262 'read_more_style',
3263 array(
3264 'label' => __( 'Button', 'premium-addons-for-elementor' ),
3265 'tab' => Controls_Manager::TAB_STYLE,
3266 'condition' => array(
3267 'premium_blog_excerpt' => 'yes',
3268 'premium_blog_excerpt_type' => 'link',
3269 'premium_blog_skin!' => $options['skin_condition'],
3270 ),
3271 )
3272 );
3273
3274 $this->add_group_control(
3275 Group_Control_Typography::get_type(),
3276 array(
3277 'name' => 'read_more_typo',
3278 'selector' => '{{WRAPPER}} .premium-blog-excerpt-link',
3279 )
3280 );
3281
3282 $this->add_responsive_control(
3283 'read_more_spacing',
3284 array(
3285 'label' => __( 'Spacing', 'premium-addons-for-elementor' ),
3286 'type' => Controls_Manager::SLIDER,
3287 'selectors' => array(
3288 '{{WRAPPER}} .premium-blog-excerpt-link' => 'margin-top: {{SIZE}}px',
3289 ),
3290 )
3291 );
3292
3293 $this->start_controls_tabs( 'read_more_style_tabs' );
3294
3295 $this->start_controls_tab(
3296 'read_more_tab_normal',
3297 array(
3298 'label' => __( 'Normal', 'premium-addons-for-elementor' ),
3299
3300 )
3301 );
3302
3303 $this->add_control(
3304 'read_more_color',
3305 array(
3306 'label' => __( 'Color', 'premium-addons-for-elementor' ),
3307 'type' => Controls_Manager::COLOR,
3308 'selectors' => array(
3309 '{{WRAPPER}} .premium-blog-excerpt-link' => 'color: {{VALUE}};',
3310 ),
3311 )
3312 );
3313
3314 $this->add_control(
3315 'read_more_background_color',
3316 array(
3317 'label' => __( 'Background Color', 'premium-addons-for-elementor' ),
3318 'type' => Controls_Manager::COLOR,
3319 'selectors' => array(
3320 '{{WRAPPER}} .premium-blog-excerpt-link' => 'background-color: {{VALUE}};',
3321 ),
3322 )
3323 );
3324
3325 $this->add_group_control(
3326 Group_Control_Border::get_type(),
3327 array(
3328 'name' => 'read_more_border',
3329 'selector' => '{{WRAPPER}} .premium-blog-excerpt-link',
3330 )
3331 );
3332
3333 $this->add_control(
3334 'read_more_border_radius',
3335 array(
3336 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ),
3337 'type' => Controls_Manager::SLIDER,
3338 'size_units' => array( 'px', 'em', '%' ),
3339 'selectors' => array(
3340 '{{WRAPPER}} .premium-blog-excerpt-link' => 'border-radius: {{SIZE}}{{UNIT}};',
3341 ),
3342 )
3343 );
3344
3345 $this->end_controls_tab();
3346
3347 $this->start_controls_tab(
3348 'read_more_tab_hover',
3349 array(
3350 'label' => __( 'Hover', 'premium-addons-for-elementor' ),
3351 )
3352 );
3353
3354 $this->add_control(
3355 'premium_blog_read_more_hover_color',
3356 array(
3357 'label' => __( 'Color', 'premium-addons-for-elementor' ),
3358 'type' => Controls_Manager::COLOR,
3359 'selectors' => array(
3360 '{{WRAPPER}} .premium-blog-excerpt-link:hover' => 'color: {{VALUE}};',
3361 ),
3362 )
3363 );
3364
3365 $this->add_control(
3366 'read_more_hover_background_color',
3367 array(
3368 'label' => __( 'Background Color', 'premium-addons-for-elementor' ),
3369 'type' => Controls_Manager::COLOR,
3370 'selectors' => array(
3371 '{{WRAPPER}} .premium-blog-excerpt-link:hover' => 'background-color: {{VALUE}};',
3372 ),
3373 )
3374 );
3375
3376 $this->add_group_control(
3377 Group_Control_Border::get_type(),
3378 array(
3379 'name' => 'read_more_hover_border',
3380 'selector' => '{{WRAPPER}} .premium-blog-excerpt-link:hover',
3381 )
3382 );
3383
3384 $this->add_control(
3385 'read_more_hover_border_radius',
3386 array(
3387 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ),
3388 'type' => Controls_Manager::SLIDER,
3389 'size_units' => array( 'px', 'em', '%' ),
3390 'selectors' => array(
3391 '{{WRAPPER}} .premium-blog-excerpt-link:hover' => 'border-radius: {{SIZE}}{{UNIT}};',
3392 ),
3393 )
3394 );
3395
3396 $this->end_controls_tab();
3397
3398 $this->end_controls_tabs();
3399
3400 $this->add_responsive_control(
3401 'read_more_padding',
3402 array(
3403 'label' => __( 'Padding', 'premium-addons-for-elementor' ),
3404 'type' => Controls_Manager::DIMENSIONS,
3405 'size_units' => array( 'px', 'em', '%' ),
3406 'separator' => 'before',
3407 'selectors' => array(
3408 '{{WRAPPER}} .premium-blog-excerpt-link' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
3409 ),
3410 )
3411 );
3412
3413 $this->end_controls_section();
3414
3415 $this->start_controls_section(
3416 'tags_style_section',
3417 array(
3418 'label' => __( 'Tags', 'premium-addons-for-elementor' ),
3419 'tab' => Controls_Manager::TAB_STYLE,
3420 'condition' => array(
3421 'premium_blog_tags_meta' => 'yes',
3422 'premium_blog_skin!' => $options['skin_condition'],
3423 ),
3424 )
3425 );
3426
3427 $this->add_group_control(
3428 Group_Control_Typography::get_type(),
3429 array(
3430 'name' => 'tags_typo',
3431 'global' => array(
3432 'default' => Global_Typography::TYPOGRAPHY_SECONDARY,
3433 ),
3434 'selector' => '{{WRAPPER}} .premium-blog-post-tags-container',
3435 )
3436 );
3437
3438 $this->add_control(
3439 'tags_color',
3440 array(
3441 'label' => __( 'Color', 'premium-addons-for-elementor' ),
3442 'type' => Controls_Manager::COLOR,
3443 'global' => array(
3444 'default' => Global_Colors::COLOR_SECONDARY,
3445 ),
3446 'selectors' => array(
3447 '{{WRAPPER}} .premium-blog-post-tags-container' => 'color: {{VALUE}}',
3448 ),
3449 )
3450 );
3451
3452 $this->add_control(
3453 'tags_hover_color',
3454 array(
3455 'label' => __( 'Hover Color', 'premium-addons-for-elementor' ),
3456 'type' => Controls_Manager::COLOR,
3457 'selectors' => array(
3458 '{{WRAPPER}} .premium-blog-post-tags-container a:hover' => 'color: {{VALUE}}',
3459 ),
3460 )
3461 );
3462
3463 $this->end_controls_section();
3464
3465 $this->start_controls_section(
3466 'box_style_section',
3467 array(
3468 'label' => __( 'Box', 'premium-addons-for-elementor' ),
3469 'tab' => Controls_Manager::TAB_STYLE,
3470 )
3471 );
3472
3473 $this->add_control(
3474 'box_background_color',
3475 array(
3476 'label' => __( 'Background Color', 'premium-addons-for-elementor' ),
3477 'type' => Controls_Manager::COLOR,
3478 'selectors' => array(
3479 '{{WRAPPER}} .premium-blog-post-container' => 'background-color: {{VALUE}};',
3480 ),
3481 )
3482 );
3483
3484 $this->add_group_control(
3485 Group_Control_Border::get_type(),
3486 array(
3487 'name' => 'box_border',
3488 'selector' => '{{WRAPPER}} .premium-blog-post-container',
3489 )
3490 );
3491
3492 $this->add_control(
3493 'box_border_radius',
3494 array(
3495 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ),
3496 'type' => Controls_Manager::SLIDER,
3497 'size_units' => array( 'px', 'em', '%' ),
3498 'selectors' => array(
3499 '{{WRAPPER}} .premium-blog-post-container' => 'border-radius: {{SIZE}}{{UNIT}};',
3500 ),
3501 )
3502 );
3503
3504 $this->add_group_control(
3505 Group_Control_Box_Shadow::get_type(),
3506 array(
3507 'name' => 'outer_box_shadow',
3508 'selector' => '{{WRAPPER}} .premium-blog-post-container',
3509 )
3510 );
3511
3512 $this->add_responsive_control(
3513 'box_padding',
3514 array(
3515 'label' => __( 'Spacing', 'premium-addons-for-elementor' ),
3516 'type' => Controls_Manager::DIMENSIONS,
3517 'size_units' => array( 'px', 'em', '%' ),
3518 'selectors' => array(
3519 '{{WRAPPER}} .premium-blog-post-outer-container' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
3520 ),
3521 )
3522 );
3523
3524 $this->add_responsive_control(
3525 'inner_box_padding',
3526 array(
3527 'label' => __( 'Padding', 'premium-addons-for-elementor' ),
3528 'type' => Controls_Manager::DIMENSIONS,
3529 'size_units' => array( 'px', 'em', '%' ),
3530 'selectors' => array(
3531 '{{WRAPPER}} .premium-blog-post-container' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
3532 ),
3533 )
3534 );
3535 }
3536
3537 /**
3538 * Render Image Scroll widget output on the frontend.
3539 *
3540 * Written in PHP and used to generate the final HTML.
3541 *
3542 * @since 1.0.0
3543 * @access protected
3544 */
3545 protected function render() {
3546
3547 $settings = $this->get_settings();
3548
3549 $papro_activated = apply_filters( 'papro_activated', false );
3550
3551 if ( ! $papro_activated && ( in_array( $settings['premium_blog_skin'], array( 'cards', 'banner' ), true ) || 'post' !== $settings['post_type_filter'] ) ) {
3552 ?>
3553 <div class="premium-error-notice">
3554 <?php
3555 $message = __( 'This option is available in <b>Premium Addons Pro</b>.', 'premium-addons-for-elementor' );
3556 echo wp_kses_post( $message );
3557 ?>
3558 </div>
3559 <?php
3560 return false;
3561 }
3562
3563 $settings['widget_id'] = $this->get_id();
3564 $settings['premium_blog_cat_tabs'] = '';
3565
3566 $blog_helper = $this->get_blog_helper();
3567
3568 $blog_helper->set_widget_settings( $settings );
3569
3570 $icon_type = $settings['icon_type'];
3571
3572 if ( 'image' === $icon_type ) {
3573
3574 if ( ! empty( $settings['image']['url'] ) ) {
3575 $image_html = Group_Control_Image_Size::get_attachment_image_html( $settings, 'thumbnail', 'image' );
3576 }
3577
3578 if ( ! empty( $settings['image_with_no_posts']['url'] ) ) {
3579 $image_html_with_no_post = Group_Control_Image_Size::get_attachment_image_html( $settings, 'thumbnail', 'image_with_no_posts' );
3580 }
3581 }
3582
3583 $this->add_render_attribute( 'icon_wrap', 'class', 'pa-rec-not-icon-wrap' );
3584
3585 $this->add_render_attribute( 'number', 'class', 'pa-rec-not-number' );
3586
3587 $this->add_render_attribute( 'posts_container', 'class', array( 'pa-rec-posts-container', 'elementor-invisible' ) );
3588
3589 $this->add_render_attribute( 'title_wrap', 'class', 'pa-rec-title-wrap' );
3590
3591 $data = $this->get_posts_number();
3592
3593 $number = $data['number'];
3594
3595 if ( $settings['cookies'] ) {
3596
3597 $id = $this->get_id();
3598
3599 $stored_posts = isset( $_COOKIE[ 'paRecentPosts' . $id ] ) && ! empty( $_COOKIE[ 'paRecentPosts' . $id ] ) ?
3600 sanitize_text_field( wp_unslash( $_COOKIE[ 'paRecentPosts' . $id ] ) ) : 'new';
3601
3602 if ( 'new' !== $stored_posts ) {
3603
3604 $difference = array_diff( explode( ',', $stored_posts ), explode( ',', $data['posts'] ) );
3605
3606 $number = count( $difference );
3607
3608 }
3609 }
3610
3611 $this->add_render_attribute(
3612 'wrap',
3613 array(
3614 'class' => 'pa-recent-notification',
3615 'data-recent' => $data['posts'],
3616 )
3617 );
3618
3619 if ( 'animation' === $icon_type ) {
3620
3621 $this->add_render_attribute(
3622 'lottie_icon',
3623 array(
3624 'class' => array( 'premium-lottie-animation', 'premium-notification-icon' ),
3625 'data-lottie-url' => $settings['lottie_url'],
3626 'data-lottie-loop' => $settings['lottie_loop'],
3627 'data-lottie-reverse' => $settings['lottie_reverse'],
3628 )
3629 );
3630
3631 } elseif ( 'icon' === $icon_type || 'svg' === $icon_type ) {
3632
3633 $this->add_render_attribute( 'icon', 'class', array( 'premium-drawable-icon', 'premium-notification-icon' ) );
3634
3635 if ( ( 'yes' === $settings['draw_svg'] && 'icon' === $icon_type ) || 'svg' === $icon_type ) {
3636 $this->add_render_attribute( 'icon', 'class', 'premium-not-icon' );
3637 }
3638
3639 if ( 'yes' === $settings['draw_svg'] ) {
3640 $this->add_render_attribute( 'wrap', 'class', 'elementor-invisible' );
3641
3642 if ( 'icon' === $icon_type ) {
3643 $this->add_render_attribute( 'icon', 'class', $settings['icon']['value'] );
3644 }
3645
3646 $this->add_render_attribute(
3647 'icon',
3648 array(
3649 'class' => 'premium-svg-drawer',
3650 'data-svg-reverse' => $settings['lottie_reverse'],
3651 'data-svg-loop' => $settings['lottie_loop'],
3652 'data-svg-sync' => $settings['svg_sync'],
3653 'data-svg-frames' => $settings['frames'],
3654 'data-svg-yoyo' => $settings['svg_yoyo'],
3655 'data-svg-point' => $settings['lottie_reverse'] ? $settings['end_point']['size'] : $settings['start_point']['size'],
3656 )
3657 );
3658
3659 } else {
3660 $this->add_render_attribute( 'icon', 'class', 'premium-svg-nodraw' );
3661 }
3662 }
3663
3664 $header_icon_type = $settings['header_icon_type'];
3665
3666 if ( 'yes' === $settings['header_icon_sw'] ) {
3667
3668 $this->add_render_attribute( 'header_icon_wrap', 'class', 'pa-rec-title-icon-wrap' );
3669
3670 if ( 'animation' === $header_icon_type ) {
3671
3672 $this->add_render_attribute(
3673 'header_lottie_icon',
3674 array(
3675 'class' => 'premium-lottie-animation',
3676 'data-lottie-url' => $settings['header_lottie_url'],
3677 'data-lottie-loop' => $settings['header_lottie_loop'],
3678 )
3679 );
3680
3681 } elseif ( 'icon' === $header_icon_type || 'svg' === $header_icon_type ) {
3682
3683 $this->add_render_attribute( 'header_icon', 'class', 'premium-drawable-icon' );
3684
3685 // if ( ( 'yes' === $settings['header_draw_svg'] && 'icon' === $header_icon_type ) || 'svg' === $header_icon_type ) {
3686 // $this->add_render_attribute( 'header_icon', 'class', 'premium-not-icon' );
3687 // }
3688
3689 if ( 'yes' === $settings['header_draw_svg'] ) {
3690
3691 if ( 'icon' === $header_icon_type ) {
3692 $this->add_render_attribute( 'header_icon', 'class', $settings['header_icon']['value'] );
3693 }
3694
3695 $this->add_render_attribute(
3696 'header_icon',
3697 array(
3698 'class' => 'premium-svg-drawer',
3699 'data-svg-reverse' => false,
3700 'data-svg-loop' => $settings['header_lottie_loop'],
3701 'data-svg-sync' => $settings['header_svg_sync'],
3702 'data-svg-frames' => $settings['header_frames'],
3703 'data-svg-yoyo' => $settings['header_svg_yoyo'],
3704 )
3705 );
3706
3707 } else {
3708 $this->add_render_attribute( 'header_icon', 'class', 'premium-svg-nodraw' );
3709 }
3710 }
3711 }
3712
3713 ?>
3714
3715 <div <?php echo wp_kses_post( $this->get_render_attribute_string( 'wrap' ) ); ?>>
3716
3717 <div <?php echo wp_kses_post( $this->get_render_attribute_string( 'icon_wrap' ) ); ?>>
3718 <?php if ( 'image' === $icon_type ) : ?>
3719
3720 <?php echo wp_kses_post( $image_html ); ?>
3721
3722 <?php elseif ( 'animation' === $icon_type ) : ?>
3723
3724 <div <?php echo wp_kses_post( $this->get_render_attribute_string( 'lottie_icon' ) ); ?>></div>
3725
3726 <?php elseif ( 'icon' === $icon_type ) : ?>
3727 <?php
3728 if ( 'yes' !== $settings['draw_svg'] ) :
3729 Icons_Manager::render_icon(
3730 $settings['icon'],
3731 array(
3732 'class' => array( 'premium-not-icon', 'premium-svg-nodraw', 'premium-drawable-icon', 'premium-notification-icon' ),
3733 'aria-hidden' => 'true',
3734 )
3735 );
3736 else :
3737 ?>
3738 <i <?php echo wp_kses_post( $this->get_render_attribute_string( 'icon' ) ); ?>></i>
3739 <?php endif; ?>
3740
3741 <?php elseif ( 'svg' === $icon_type ) : ?>
3742 <div <?php echo wp_kses_post( $this->get_render_attribute_string( 'icon' ) ); ?>>
3743 <?php $this->print_unescaped_setting( 'custom_svg' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
3744 </div>
3745 <?php else : ?>
3746 <p class="premium-not-icon-text premium-notification-icon">
3747 <?php echo wp_kses_post( $settings['text'] ); ?>
3748 </p>
3749
3750 <?php endif; ?>
3751
3752 <?php if ( 'image' === $icon_type ) : ?>
3753 <?php echo wp_kses_post( $image_html_with_no_post ); ?>
3754
3755 <?php else : ?>
3756 <?php
3757 Icons_Manager::render_icon(
3758 $settings['icon_with_no_posts'],
3759 array(
3760 'class' => array( 'premium-not-icon', 'premium-svg-nodraw', 'premium-drawable-icon', 'premium-icon-with-no-post' ),
3761 'aria-hidden' => 'true',
3762 )
3763 );
3764 ?>
3765 <?php endif; ?>
3766
3767 <?php if ( $number > 0 ) : ?>
3768 <div <?php echo wp_kses_post( $this->get_render_attribute_string( 'number' ) ); ?>>
3769 <span><?php echo wp_kses_post( $number ); ?></span>
3770 </div>
3771 <?php endif; ?>
3772
3773 </div>
3774
3775 </div>
3776
3777 <div <?php echo wp_kses_post( $this->get_render_attribute_string( 'posts_container' ) ); ?>>
3778 <div class="pa-rec-posts-header">
3779
3780 <div <?php echo wp_kses_post( $this->get_render_attribute_string( 'title_wrap' ) ); ?>>
3781
3782 <?php if ( 'yes' === $settings['header_icon_sw'] ) : ?>
3783
3784 <div <?php echo wp_kses_post( $this->get_render_attribute_string( 'header_icon_wrap' ) ); ?>>
3785 <?php if ( 'image' === $header_icon_type ) : ?>
3786
3787 <?php $img_src = wp_get_attachment_image_src( $settings['header_image']['id'], 'thumbnail' ); ?>
3788
3789 <img src="<?php echo esc_url( $img_src[0] ); ?>" alt="<?php echo esc_attr( $settings['header_image']['alt'] ); ?>">
3790 <?php elseif ( 'animation' === $header_icon_type ) : ?>
3791
3792 <div <?php echo wp_kses_post( $this->get_render_attribute_string( 'header_lottie_icon' ) ); ?>></div>
3793
3794 <?php elseif ( 'icon' === $header_icon_type ) : ?>
3795 <?php
3796 if ( 'yes' !== $settings['header_draw_svg'] ) :
3797 Icons_Manager::render_icon(
3798 $settings['header_icon'],
3799 array(
3800 'class' => array( 'premium-svg-nodraw', 'premium-drawable-icon' ),
3801 'aria-hidden' => 'true',
3802 )
3803 );
3804 else :
3805 ?>
3806 <i <?php echo wp_kses_post( $this->get_render_attribute_string( 'header_icon' ) ); ?>></i>
3807 <?php endif; ?>
3808
3809 <?php else : ?>
3810 <div <?php echo wp_kses_post( $this->get_render_attribute_string( 'header_icon' ) ); ?>>
3811 <?php $this->print_unescaped_setting( 'header_custom_svg' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
3812 </div>
3813 <?php endif; ?>
3814
3815 </div>
3816
3817 <?php endif; ?>
3818
3819 <<?php echo Helper_Functions::validate_html_tag( $settings['header_size'] ); ?> class="pa-rec-title">
3820 <?php echo wp_kses_post( $settings['header_text'] ); ?>
3821 </<?php echo Helper_Functions::validate_html_tag( $settings['header_size'] ); ?>>
3822
3823
3824 </div>
3825
3826 <div class="pa-rec-posts-close">
3827 <i class="pa-rec-posts-close-icon fa fa-close"></i>
3828 </div>
3829 </div>
3830
3831 <div class="pa-rec-posts-body">
3832 <?php
3833
3834 if ( 'yes' === $settings['cookies'] && 0 == $number && 'template' === $settings['shown_content'] ) {
3835 $template = empty( $settings['content_temp'] ) ? $settings['live_temp_content'] : $settings['content_temp'];
3836 echo $this->get_blog_helper()->get_template_content( $template ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
3837 } else {
3838 $id = $this->get_id();
3839 $blog_helper->render_posts();
3840 }
3841
3842 ?>
3843 </div>
3844
3845
3846 </div>
3847
3848 <?php if ( 'yes' === $settings['overlay'] ) : ?>
3849 <div class="pa-rec-posts-overlay"></div>
3850 <?php endif; ?>
3851
3852 <?php
3853 }
3854
3855 /**
3856 * Get Posts Number
3857 *
3858 * Used to get the number of posts to check.
3859 *
3860 * @access protected
3861 *
3862 * @return integer $number posts number.
3863 */
3864 protected function get_posts_number() {
3865
3866 $settings = $this->get_settings_for_display();
3867
3868 $queried_posts_ids = array();
3869
3870 if ( 'yes' !== $settings['cookies'] || is_user_logged_in() ) {
3871 // if ( 'yes' !== $settings['cookies'] ) {
3872 $number = ! empty( $settings['posts_number'] ) ? $settings['posts_number'] : 3;
3873 } else {
3874
3875 $blog_helper = $this->get_blog_helper();
3876
3877 $query = $blog_helper->get_query_posts();
3878
3879 $posts = $query->posts;
3880
3881 $this->query_posts = $posts;
3882
3883 foreach ( $posts as $post ) {
3884 $queried_posts_ids[] = $post->ID;
3885 }
3886
3887 $number = count( $posts ) ? count( $posts ) : 0;
3888
3889 if ( count( $posts ) ) {
3890
3891 // setcookie( 'username', 'john_doe', time() + 3600 );
3892 $queried_posts_ids = implode( ',', $queried_posts_ids );
3893
3894 // global $post;
3895
3896 // foreach ( $posts as $post ) {
3897 // setup_postdata( $post );
3898 // $this->get_post_layout();
3899 // }
3900 } else {
3901 $queried_posts_ids = '';
3902 }
3903
3904 // wp_reset_postdata();
3905
3906 }
3907
3908 return array(
3909 'number' => $number,
3910 'posts' => $queried_posts_ids,
3911 );
3912 }
3913 }
3914