PluginProbe
aBlocks – Gutenberg Blocks, User Dashboard Builder, Popup Builder, Form Builder & Animation Builder / 2.14.0
aBlocks – Gutenberg Blocks, User Dashboard Builder, Popup Builder, Form Builder & Animation Builder v2.14.0
2.14.0 2.13.0 2.13.1 2.12.0 2.11.1 2.11.0 2.10.0 2.9.0 2.7.4 2.7.5 2.7.6 2.7.7 2.8.0 2.8.1 2.9.1 trunk 1.0 1.0-beta1 1.0-beta2 1.0-beta3 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 All 81 releases
← All changes | includes/blocks/news-ticker/block.php +126 -142 2.9.1 → 2.14.0 View file →
@@ -6,27 +6,27 @@
6 6 }
7 7
8 8 use ABlocks\Classes\BlockBaseAbstract;
9 9 use ABlocks\Classes\CssGenerator;
10 +use ABlocks\Classes\CssGeneratorV2;
10 11 use ABlocks\Controls\Typography;
11 12 use ABlocks\Controls\TextShadow;
12 13 use ABlocks\Controls\TextStroke;
13 14 use ABlocks\Controls\Range;
15 +use ABlocks\Controls\Color;
14 16
15 17 class Block extends BlockBaseAbstract {
16 18 protected $block_name = 'news-ticker';
17 19
18 -
19 -
20 20 public function build_css( $attributes ) {
21 - // Generate CSS start
22 - $css_generator = new CssGenerator( $attributes, $this->block_name );
21 + $css_generator = new CssGeneratorV2( $attributes, $this->block_name );
23 22
24 23 $css_generator->add_class_styles(
25 24 '{{WRAPPER}} .ablocks-block-news-ticker__label',
26 25 $this->get_label_css( $attributes ),
27 26 $this->get_label_css( $attributes, 'Tablet' ),
28 - $this->get_label_css( $attributes, 'Mobile' )
27 + $this->get_label_css( $attributes, 'Mobile' ),
28 + $css_generator->custom_device_map( function ( $device ) use ( $attributes ) { return $this->get_label_css( $attributes, $device ); } )
29 29 );
30 30
31 31 $css_generator->add_class_styles(
32 32 '{{WRAPPER}} .ablocks-block-news-ticker__label:hover',
@@ -31,9 +31,10 @@
31 31 $css_generator->add_class_styles(
32 32 '{{WRAPPER}} .ablocks-block-news-ticker__label:hover',
33 33 $this->get_label_color_hover_css( $attributes ),
34 34 $this->get_label_color_hover_css( $attributes, 'Tablet' ),
35 - $this->get_label_color_hover_css( $attributes, 'Mobile' )
35 + $this->get_label_color_hover_css( $attributes, 'Mobile' ),
36 + $css_generator->custom_device_map( function ( $device ) use ( $attributes ) { return $this->get_label_color_hover_css( $attributes, $device ); } )
36 37 );
37 38
38 39 $css_generator->add_class_styles(
39 40 '{{WRAPPER}} .ablocks-block-news-ticker',
@@ -38,9 +39,10 @@
38 39 $css_generator->add_class_styles(
39 40 '{{WRAPPER}} .ablocks-block-news-ticker',
40 41 $this->get_ticker_content_css( $attributes ),
41 42 $this->get_ticker_content_css( $attributes, 'Tablet' ),
42 - $this->get_ticker_content_css( $attributes, 'Mobile' )
43 + $this->get_ticker_content_css( $attributes, 'Mobile' ),
44 + $css_generator->custom_device_map( function ( $device ) use ( $attributes ) { return $this->get_ticker_content_css( $attributes, $device ); } )
43 45 );
44 46
45 47 $css_generator->add_class_styles(
46 48 '{{WRAPPER}} .ablocks-block-news-ticker__marquee',
@@ -45,9 +47,10 @@
45 47 $css_generator->add_class_styles(
46 48 '{{WRAPPER}} .ablocks-block-news-ticker__marquee',
47 49 $this->get_ticker_color_css( $attributes ),
48 50 $this->get_ticker_color_css( $attributes, 'Tablet' ),
49 - $this->get_ticker_color_css( $attributes, 'Mobile' )
51 + $this->get_ticker_color_css( $attributes, 'Mobile' ),
52 + $css_generator->custom_device_map( function ( $device ) use ( $attributes ) { return $this->get_ticker_color_css( $attributes, $device ); } )
50 53 );
51 54
52 55 $css_generator->add_class_styles(
53 56 '{{WRAPPER}} .ablocks-block-news-ticker__marquee:hover',
@@ -52,9 +55,10 @@
52 55 $css_generator->add_class_styles(
53 56 '{{WRAPPER}} .ablocks-block-news-ticker__marquee:hover',
54 57 $this->get_ticker_color_hover_css( $attributes ),
55 58 $this->get_ticker_color_hover_css( $attributes, 'Tablet' ),
56 - $this->get_ticker_color_hover_css( $attributes, 'Mobile' )
59 + $this->get_ticker_color_hover_css( $attributes, 'Mobile' ),
60 + $css_generator->custom_device_map( function ( $device ) use ( $attributes ) { return $this->get_ticker_color_hover_css( $attributes, $device ); } )
57 61 );
58 62
59 63 $css_generator->add_class_styles(
60 64 '{{WRAPPER}} .ablocks-block-news-ticker--icons',
@@ -79,9 +83,10 @@
79 83 $css_generator->add_class_styles(
80 84 '{{WRAPPER}} .ablocks-block-news-ticker__list',
81 85 $this->get_ticker_list_styles_css( $attributes ),
82 86 $this->get_ticker_list_styles_css( $attributes, 'Tablet' ),
83 - $this->get_ticker_list_styles_css( $attributes, 'Mobile' )
87 + $this->get_ticker_list_styles_css( $attributes, 'Mobile' ),
88 + $css_generator->custom_device_map( function ( $device ) use ( $attributes ) { return $this->get_ticker_list_styles_css( $attributes, $device ); } )
84 89 );
85 90
86 91 $css_generator->add_class_styles(
87 92 '{{WRAPPER}} .ablocks-block-news-ticker--date',
@@ -92,17 +97,8 @@
92 97 }
93 98
94 99 public function get_label_css( $attributes, $device = '' ) {
95 100 $label_css = [];
96 -
97 - if ( ! empty( $attributes['labelColor'] ) ) {
98 - $label_css['color'] = $attributes['labelColor'];
99 - }
100 -
101 - if ( ! empty( $attributes['labelBackgroundColor'] ) ) {
102 - $label_css['background-color'] = $attributes['labelBackgroundColor'];
103 - }
104 -
105 101 if ( isset( $attributes['isShowLabel'] ) && $attributes['isShowLabel'] ) {
106 102 $label_css['display'] = 'flex';
107 103 } else {
108 104 $label_css['display'] = 'none';
@@ -134,12 +130,15 @@
134 130 $label_css['clip-path'] = '';
135 131 break;
136 132 }
137 133 }
138 - $typography_css = ! empty( $attributes['labelTypography'] ) ? Typography::get_css( $attributes['labelTypography'], '', $device ) : array();
134 + $typographyValueGlobal = ! empty( $attributes['labelTypographyGlobal'] ) ? $attributes['labelTypographyGlobal'] : array();
135 + $typography_css = ! empty( $attributes['labelTypography'] ) ? Typography::get_css( $attributes['labelTypography'], '', $device, $typographyValueGlobal ) : array();
139 136 $textShadowCss = ! empty( $attributes['labelTextShadow'] ) ? TextShadow::get_css( $attributes['labelTextShadow'], '', $device ) : array();
140 137 $textStrokeCss = ! empty( $attributes['labelTextStroke'] ) ? TextStroke::get_css( $attributes['labelTextStroke'], '', $device ) : array();
141 138 return array_merge(
139 + [ 'color' => Color::get_css( isset( $attributes['labelColor'] ) ? $attributes['labelColor'] : '' ) ],
140 + [ 'background' => Color::get_css( isset( $attributes['labelBackgroundColor'] ) ? $attributes['labelBackgroundColor'] : '' ) ],
142 141 Range::get_css([
143 142 'attributeValue' => $attributes['labelPadding'],
144 143 'attribute_object_key' => 'value',
145 144 'isResponsive' => true,
@@ -157,19 +156,11 @@
157 156 }
158 157
159 158
160 159 public function get_label_color_hover_css( $attributes ) {
161 - $labelColorHoverCSS = [];
162 -
163 - if ( ! empty( $attributes['labelColorH'] ) ) {
164 - $labelColorHoverCSS['color'] = $attributes['labelColorH'];
165 - }
166 -
167 - if ( ! empty( $attributes['labelBackgroundColorH'] ) ) {
168 - $labelColorHoverCSS['background-color'] = $attributes['labelBackgroundColorH'];
169 - }
170 -
171 160 return array_merge(
161 + [ 'color' => Color::get_css( isset( $attributes['labelColorH'] ) ? $attributes['labelColorH'] : '' ) ],
162 + [ 'background' => Color::get_css( isset( $attributes['labelBackgroundColorH'] ) ? $attributes['labelBackgroundColorH'] : '' ) ],
172 163 Range::get_css([
173 164 'attributeValue' => $attributes['labelColorTransition'],
174 165 'attribute_object_key' => 'value',
175 166 'defaultValue' => 0,
@@ -175,9 +166,8 @@
175 166 'defaultValue' => 0,
176 167 'unitDefaultValue' => 's',
177 168 'property' => 'transition-duration',
178 169 ]),
179 - $labelColorHoverCSS
180 170 );
181 171 }
182 172
183 173 public function get_ticker_content_css( $attributes, $device = '' ) {
@@ -229,10 +219,10 @@
229 219 default:
230 220 $ticker_list_styles_css['list-style'] = 'none';
231 221 }
232 222 }
233 -
234 - $typography_css = ! empty( $attributes['tickerTypography'] ) ? Typography::get_css( $attributes['tickerTypography'], '', $device ) : array();
223 + $typographyValueGlobal = ! empty( $attributes['tickerTypographyGlobal'] ) ? $attributes['tickerTypographyGlobal'] : array();
224 + $typography_css = ! empty( $attributes['tickerTypography'] ) ? Typography::get_css( $attributes['tickerTypography'], '', $device, $typographyValueGlobal ) : array();
235 225 $textShadowCss = ! empty( $attributes['tickerTextShadow'] ) ? TextShadow::get_css( $attributes['tickerTextShadow'], '', $device ) : array();
236 226 $textStrokeCss = ! empty( $attributes['tickerTextStroke'] ) ? TextStroke::get_css( $attributes['tickerTextStroke'], '', $device ) : array();
237 227
238 228 return array_merge(
@@ -242,33 +232,18 @@
242 232 $textStrokeCss );
243 233 }
244 234
245 235 public function get_ticker_color_css( $attributes ) {
246 - $tickerColorCSS = [];
247 -
248 - if ( isset( $attributes['tickerColor'] ) && ! empty( $attributes['tickerColor'] ) ) {
249 - $tickerColorCSS['color'] = $attributes['tickerColor'];
250 - }
251 -
252 - if ( isset( $attributes['tickerBgColor'] ) && ! empty( $attributes['tickerBgColor'] ) ) {
253 - $tickerColorCSS['background'] = $attributes['tickerBgColor'];
254 - }
255 -
256 - return $tickerColorCSS;
236 + return array_merge(
237 + [ 'color' => Color::get_css( isset( $attributes['tickerColor'] ) ? $attributes['tickerColor'] : '' ) ],
238 + [ 'background' => Color::get_css( isset( $attributes['tickerBgColor'] ) ? $attributes['tickerBgColor'] : '' ) ],
239 + );
257 240 }
258 241
259 242 public function get_ticker_color_hover_css( $attributes ) {
260 - $tickerColorHoverCSS = [];
261 -
262 - if ( isset( $attributes['tickerColorH'] ) && ! empty( $attributes['tickerColorH'] ) ) {
263 - $tickerColorHoverCSS['color'] = $attributes['tickerColorH'];
264 - }
265 -
266 - if ( isset( $attributes['tickerBgColorH'] ) && ! empty( $attributes['tickerBgColorH'] ) ) {
267 - $tickerColorHoverCSS['background'] = $attributes['tickerBgColorH'];
268 - }
269 -
270 243 return array_merge(
244 + [ 'color' => Color::get_css( isset( $attributes['tickerColorH'] ) ? $attributes['tickerColorH'] : '' ) ],
245 + [ 'background' => Color::get_css( isset( $attributes['tickerBgColorH'] ) ? $attributes['tickerBgColorH'] : '' ) ],
271 246 Range::get_css([
272 247 'attributeValue' => $attributes['tickerColorTransition'],
273 248 'attribute_object_key' => 'value',
274 249 'defaultValue' => 0,
@@ -273,10 +248,9 @@
273 248 'attribute_object_key' => 'value',
274 249 'defaultValue' => 0,
275 250 'unitDefaultValue' => 's',
276 251 'property' => 'transition-duration',
277 - ]),
278 - $tickerColorHoverCSS
252 + ])
279 253 );
280 254 }
281 255
282 256 public function get_navigator_css( $attributes ) {
@@ -297,15 +271,10 @@
297 271
298 272 return $navigator_css;
299 273 }
300 274 public function get_navigator_color_css( $attributes ) {
301 - $navigator_css = [];
275 + return [ 'background' => Color::get_css( isset( $attributes['navigatorBgColor'] ) ? $attributes['navigatorBgColor'] : '' ) ];
302 276
303 - if ( isset( $attributes['navigatorBgColor'] ) && $attributes['navigatorBgColor'] ) {
304 - $navigator_css['background'] = $attributes['navigatorBgColor'];
305 - }
306 -
307 - return $navigator_css;
308 277 }
309 278
310 279 public function get_show_time_css( $attributes ) {
311 280 $time_show_css = [];
@@ -319,23 +288,21 @@
319 288 return $time_show_css;
320 289 }
321 290
322 291
323 -
324 -
325 292 public function render_block_content( $attributes, $content, $block_instance ) {
326 - $sticky_label = $attributes['stickyLabel'] ?? 'Breaking News';
327 - $sticky_label_tag = $attributes['stickyLabelTag'] ?? 'span';
328 - $selected_posts = $attributes['selectedPosts'] ?? [];
329 - $selected_pages = $attributes['selectedPages'] ?? [];
330 - $slide_speed = $attributes['slideSpeed'] ?? '2';
331 - $is_pause_on_over = $attributes['isPauseOnOver'] ?? false;
332 - $show_ticker_navigator = $attributes['showTickerNavigator'] ?? false;
333 - $custom_text = $attributes['customText'] ?? '';
334 - $query_type = $attributes['queryType'] ?? '';
335 - $navigator_color = $attributes['navigatorColor'] ?? '';
336 -
337 - $post_type = ! empty( $selected_pages ) ? 'page' : 'post';
293 + $sticky_label = sanitize_text_field( $attributes['stickyLabel'] ?? 'Breaking News' );
294 + $sticky_label_tag = sanitize_html_class( $attributes['stickyLabelTag'] ?? 'span' );
295 + $selected_posts = array_map( 'absint', $attributes['selectedPosts'] ?? [] );
296 + $selected_pages = array_map( 'absint', $attributes['selectedPages'] ?? [] );
297 + $slide_speed = sanitize_text_field( $attributes['slideSpeed'] ?? '2' );
298 + $is_pause_on_over = filter_var( $attributes['isPauseOnOver'] ?? false, FILTER_VALIDATE_BOOLEAN );
299 + $show_ticker_navigator = filter_var( $attributes['showTickerNavigator'] ?? false, FILTER_VALIDATE_BOOLEAN );
300 + $custom_text = sanitize_text_field( $attributes['customText'] ?? '' );
301 + $query_type = sanitize_text_field( $attributes['queryType'] ?? '' );
302 + $navigator_color = Color::get_css( isset( $attributes['navigatorColor'] ) ? $attributes['navigatorColor'] : '' );
303 + $slide_direction = sanitize_text_field( $attributes['slideDirection'] ?? 'left' );
304 + $post_type = ! empty( $selected_pages ) ? 'page' : 'post';
338 305 $selected_items = ! empty( $selected_pages ) ? $selected_pages : $selected_posts;
339 306
340 307 $args = [
341 308 'post_type' => $post_type,
@@ -347,100 +314,118 @@
347 314 $query = new \WP_Query( $args );
348 315
349 316 ob_start();
350 317 ?>
351 - <div class="ablocks-block-news-ticker"
352 - data-slide-speed="<?php echo esc_attr( $slide_speed ); ?>"
353 - data-slide-direction="<?php echo esc_attr( $attributes['slideDirection'] ); ?>"
354 - data-pause-on-hover="<?php echo esc_attr( $is_pause_on_over ? 'true' : 'false' ); ?>"
355 - data-navigator-color="<?php echo esc_attr( $attributes['navigatorColor'] ); ?>">
356 - <<?php echo esc_attr( $sticky_label_tag ); ?> class="ablocks-block-news-ticker__label">
357 - <?php echo esc_html( $sticky_label ); ?>
358 - </<?php echo esc_attr( $sticky_label_tag ); ?>>
359 - <div class="ablocks-block-news-ticker__marquee">
360 - <div class="ablocks-block-news-ticker_marquee--content">
361 - <ul class="ablocks-block-news-ticker__list">
318 + <div class="ablocks-block-news-ticker"
319 + data-slide-speed="<?php echo esc_attr( $slide_speed ); ?>"
320 + data-slide-direction="<?php echo esc_attr( $slide_direction ); ?>"
321 + data-pause-on-hover="<?php echo esc_attr( $is_pause_on_over ? 'true' : 'false' ); ?>"
322 + data-navigator-color="<?php echo esc_attr( $navigator_color ); ?>">
323 + <<?php echo esc_attr( $sticky_label_tag ); ?> class="ablocks-block-news-ticker__label">
324 + <?php echo esc_html( $sticky_label ); ?>
325 + </<?php echo esc_attr( $sticky_label_tag ); ?>>
326 + <div class="ablocks-block-news-ticker__marquee">
327 + <div class="ablocks-block-news-ticker_marquee--content">
328 + <ul class="ablocks-block-news-ticker__list">
362 329 <?php if ( $query_type === 'customText' && ! empty( $attributes['lists'] ) ) : ?>
363 330 <?php foreach ( $attributes['lists'] as $item ) : ?>
364 - <li class="ablocks-block-news-ticker__item">
365 - <span class="ablocks-block-news-ticker__custom-text">
366 - <?php if ( ! empty( $item['link']['href'] ) ) : ?>
367 - <a
368 - href="<?php echo esc_url( $item['link']['href'] ); ?>"
369 - <?php echo ! empty( $item['link']['linkTarget'] ) ? 'target="_blank" rel="noopener noreferrer"' : ''; ?>
370 - >
371 - <?php echo esc_html( $item['text'] ); ?>
331 + <?php
332 + $text = sanitize_text_field( $item['text'] ?? '' );
333 + $href = esc_url( $item['link']['href'] ?? '' );
334 + $target = ! empty( $item['link']['linkTarget'] ) ? 'target="_blank" rel="noopener noreferrer"' : '';
335 + ?>
336 + <li class="ablocks-block-news-ticker__item">
337 + <span class="ablocks-block-news-ticker__custom-text">
338 + <?php if ( ! empty( $href ) ) : ?>
339 + <a href="<?php echo esc_url( $href ); ?>" <?php echo esc_html( $target ); ?>>
340 + <?php echo esc_html( $text ); ?>
372 341 </a>
373 342 <?php else : ?>
374 - <?php echo esc_html( $item['text'] ); ?>
343 + <?php echo esc_html( $text ); ?>
375 344 <?php endif; ?>
376 345 </span>
377 - </li>
346 + </li>
378 347 <?php endforeach; ?>
379 348 <?php elseif ( ! empty( $selected_items ) ) : ?>
380 - <?php
381 - if ( $query->have_posts() ) :
349 + <?php if ( $query->have_posts() ) :
382 350 while ( $query->have_posts() ) :
383 351 $query->the_post();
384 - $has_link = ! empty( $attributes['pageLink'] ) || ! empty( $attributes['postLink'] );
385 - $post_link = get_permalink();
352 + $has_link = ! empty( $attributes['pageLink'] ) || ! empty( $attributes['postLink'] );
353 + $post_link = get_permalink();
386 354 $link_target = '_blank';
355 + $title = get_the_title();
356 + $date = esc_html( $this->get_relative_time( get_the_date() ) );
387 357 ?>
388 358 <?php if ( $has_link ) : ?>
389 - <a href="<?php echo esc_url( $post_link ); ?>" target="<?php echo esc_attr( $link_target ); ?>">
390 - <li class="ablocks-block-news-ticker__item">
391 - <?php the_title(); ?>
392 - <span class="ablocks-block-news-ticker--date">
393 - <?php echo esc_html( $this->get_relative_time( get_the_date() ) ); ?>
394 - </span>
395 - </li>
396 - </a>
397 - <?php else : ?>
398 - <li class="ablocks-block-news-ticker__item">
399 - <?php the_title(); ?>
400 - <span class="ablocks-block-news-ticker--date">
401 - <?php echo esc_html( $this->get_relative_time( get_the_date() ) ); ?>
402 - </span>
403 - </li>
404 - <?php endif; ?>
405 - <?php
406 - endwhile;
407 - else :
408 - ?>
409 - <li>
410 - <?php
411 - // translators: %s is the post type (e.g., 'post', 'page', etc.)
412 - echo esc_html( sprintf( __( 'No %s found in the selection', 'ablocks' ), $post_type . 's' ) );
413 - ?></li>
414 - <?php endif; ?>
415 -
416 -
359 + <a href="<?php echo esc_url( $post_link ); ?>" target="<?php echo esc_attr( $link_target ); ?>">
360 + <li class="ablocks-block-news-ticker__item">
361 + <?php echo esc_html( $title ); ?>
362 + <span class="ablocks-block-news-ticker--date"><?php echo esc_html( $date ); ?></span>
363 + </li>
364 + </a>
365 + <?php else : ?>
366 + <li class="ablocks-block-news-ticker__item">
367 + <?php echo esc_html( $title ); ?>
368 + <span class="ablocks-block-news-ticker--date"><?php echo esc_html( $date ); ?></span>
369 + </li>
370 + <?php endif; ?>
371 + <?php endwhile; ?>
417 372 <?php else : ?>
418 - <li><?php esc_html_e( 'No items selected', 'ablocks' ); ?></li>
373 + <li><?php
374 + /* translators: %s template */
375 + echo esc_html( sprintf( __( 'No %s found in the selection', 'ablocks' ), $post_type . 's' ) ); ?></li>
419 376 <?php endif; ?>
420 - </ul>
421 - </div>
422 - <?php if ( $show_ticker_navigator ) : ?>
377 + <?php else : ?>
378 + <li><?php esc_html_e( 'No items selected', 'ablocks' ); ?></li>
379 + <?php endif; ?>
380 + </ul>
381 + </div>
382 +
383 + <?php if ( $show_ticker_navigator ) : ?>
423 384 <div class="ablocks-block-news-ticker--icons">
424 385 <button class="ablocks-block-news-ticker--icons__prev">
425 - <svg width="24" height="50" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
426 - <path d="M18.119 22.1309C18.2003 22.2122 18.2648 22.3087 18.3088 22.415C18.3528 22.5212 18.3755 22.635 18.3755 22.75C18.3755 22.865 18.3528 22.9788 18.3088 23.085C18.2648 23.1913 18.2003 23.2878 18.119 23.3691C18.0378 23.4504 17.9412 23.5148 17.835 23.5588C17.7288 23.6028 17.615 23.6255 17.5 23.6255C17.385 23.6255 17.2712 23.6028 17.165 23.5588C17.0587 23.5148 16.9622 23.4504 16.8809 23.3691L8.13092 14.6191C8.04957 14.5378 7.98503 14.4413 7.941 14.3351C7.89696 14.2288 7.8743 14.115 7.8743 14C7.8743 13.885 7.89696 13.7712 7.941 13.6649C7.98503 13.5587 8.04957 13.4622 8.13092 13.3809L16.8809 4.63094C17.0451 4.46675 17.2678 4.37451 17.5 4.37451C17.7322 4.37451 17.9549 4.46675 18.119 4.63094C18.2832 4.79512 18.3755 5.01781 18.3755 5.25C18.3755 5.48219 18.2832 5.70488 18.119 5.86906L9.98702 14L18.119 22.1309Z" fill="<?php echo esc_attr( $navigator_color ); ?>" />
386 + <svg
387 + width="24"
388 + height="50"
389 + viewBox="0 0 28 28"
390 + fill="none"
391 + xmlns="http://www.w3.org/2000/svg"
392 + >
393 + <path
394 + d="M18.119 22.1309C18.2003 22.2122 18.2648 22.3087 18.3088 22.415C18.3528 22.5212 18.3755 22.635 18.3755 22.75C18.3755 22.865 18.3528 22.9788 18.3088 23.085C18.2648 23.1913 18.2003 23.2878 18.119 23.3691C18.0378 23.4504 17.9412 23.5148 17.835 23.5588C17.7288 23.6028 17.615 23.6255 17.5 23.6255C17.385 23.6255 17.2712 23.6028 17.165 23.5588C17.0587 23.5148 16.9622 23.4504 16.8809 23.3691L8.13092 14.6191C8.04957 14.5378 7.98503 14.4413 7.941 14.3351C7.89696 14.2288 7.8743 14.115 7.8743 14C7.8743 13.885 7.89696 13.7712 7.941 13.6649C7.98503 13.5587 8.04957 13.4622 8.13092 13.3809L16.8809 4.63094C17.0451 4.46675 17.2678 4.37451 17.5 4.37451C17.7322 4.37451 17.9549 4.46675 18.119 4.63094C18.2832 4.79512 18.3755 5.01781 18.3755 5.25C18.3755 5.48219 18.2832 5.70488 18.119 5.86906L9.98702 14L18.119 22.1309Z"
395 + fill="<?php echo esc_attr( $navigator_color ); ?>"
396 + />
427 397 </svg>
428 398 </button>
429 - <button class="ablocks-block-news-ticker--icons__pause">
399 + <button
400 + aria-label="Pause Button"
401 + title="Pause Button"
402 + class="ablocks-block-news-ticker--icons__pause">
430 403 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="50" fill="currentColor">
431 404 <path d="M6 19h4V5H6v14zm8-14v14h4V5h-4z" />
432 405 </svg>
433 406 </button>
434 - <button class="ablocks-block-news-ticker--icons__next">
435 - <svg width="24" height="50" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
436 - <path d="M19.8691 14.6191L11.1191 23.3691C11.0378 23.4504 10.9413 23.5148 10.835 23.5588C10.7288 23.6028 10.615 23.6255 10.5 23.6255C10.385 23.6255 10.2712 23.6028 10.165 23.5588C10.0587 23.5148 9.96223 23.4504 9.88094 23.3691C9.79964 23.2878 9.73515 23.1913 9.69115 23.085C9.64716 22.9788 9.62451 22.865 9.62451 22.75C9.62451 22.635 9.64716 22.5212 9.69115 22.415C9.73515 22.3087 9.79964 22.2122 9.88094 22.1309L18.013 14L9.88094 5.86906C9.71675 5.70488 9.62451 5.48219 9.62451 5.25C9.62451 5.01781 9.71675 4.79512 9.88094 4.63094C10.0451 4.46675 10.2678 4.37451 10.5 4.37451C10.7322 4.37451 10.9549 4.46675 11.1191 4.63094L19.8691 13.3809C19.9504 13.4622 20.015 13.5587 20.059 13.6649C20.103 13.7712 20.1257 13.885 20.1257 14C20.1257 14.115 20.103 14.2288 20.059 14.3351C20.015 14.4413 19.9504 14.5378 19.8691 14.6191Z" fill="<?php echo esc_attr( $navigator_color ); ?>" />
407 + <button
408 + aria-label="Next Button"
409 + title="Next Button"
410 + class="ablocks-block-news-ticker--icons__next">
411 + <svg
412 + width="24"
413 + height="50"
414 + viewBox="0 0 28 28"
415 + fill="none"
416 + xmlns="http://www.w3.org/2000/svg"
417 + >
418 + <path
419 + d="M19.8691 14.6191L11.1191 23.3691C11.0378 23.4504 10.9413 23.5148 10.835 23.5588C10.7288 23.6028 10.615 23.6255 10.5 23.6255C10.385 23.6255 10.2712 23.6028 10.165 23.5588C10.0587 23.5148 9.96223 23.4504 9.88094 23.3691C9.79964 23.2878 9.73515 23.1913 9.69115 23.085C9.64716 22.9788 9.62451 22.865 9.62451 22.75C9.62451 22.635 9.64716 22.5212 9.69115 22.415C9.73515 22.3087 9.79964 22.2122 9.88094 22.1309L18.013 14L9.88094 5.86906C9.71675 5.70488 9.62451 5.48219 9.62451 5.25C9.62451 5.01781 9.71675 4.79512 9.88094 4.63094C10.0451 4.46675 10.2678 4.37451 10.5 4.37451C10.7322 4.37451 10.9549 4.46675 11.1191 4.63094L19.8691 13.3809C19.9504 13.4622 20.015 13.5587 20.059 13.6649C20.103 13.7712 20.1257 13.885 20.1257 14C20.1257 14.115 20.103 14.2288 20.059 14.3351C20.015 14.4413 19.9504 14.5378 19.8691 14.6191Z"
420 + fill="<?php echo esc_attr( $navigator_color ); ?>"
421 + />
437 422 </svg>
438 423 </button>
439 424 </div>
440 - <?php endif; ?>
441 - </div>
425 + <?php endif; ?>
442 426 </div>
427 + </div>
443 428 <?php
444 429
445 430 wp_reset_postdata();
446 431
@@ -445,9 +430,8 @@
445 430 wp_reset_postdata();
446 431
447 432 return ob_get_clean();
448 433 }
449 -
450 434
451 435
452 436 private function get_relative_time( $date_string ) {
453 437 $post_date = new \DateTime( $date_string );