PluginProbe
BlockSpare – Gutenberg Blocks, AI Content Generator & Site Builder for News, Magazine & Blogs / 5.0.1
BlockSpare – Gutenberg Blocks, AI Content Generator & Site Builder for News, Magazine & Blogs v5.0.1
5.0.1 4.1.0 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.1.0 1.1.1 1.1.2 1.2.0 1.2.1 1.2.2 1.2.3 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 2.1.2 2.5.0 2.5.3 All 39 releases
blockspare / build / block / date-time / render.php

render.php in BlockSpare – Gutenberg Blocks, AI Content Generator & Site Builder for News, Magazine & Blogs 5.0.1, at build/block/date-time/render.php

84 lines 3.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 $unq_class = mt_rand(100000, 999999);
4 $blockuniqueclass = '';
5 if (!empty($attributes['uniqueClass'])) {
6 $blockuniqueclass = $attributes['uniqueClass'];
7 } else {
8 $blockuniqueclass = 'blockspare-date-time-' . $unq_class;
9 }
10
11 $wrapperClass = $blockuniqueclass;
12 $mainClass = $attributes['layoutOption'] . ' ' . $attributes['layoutType'] . ' ' . $attributes['dateOrder'] . ' bs-date-time-' . $attributes['sectionAlign'] . ' ';
13 $mainClass .= $attributes['borderRadius'];
14 if ($attributes['animation']) {
15 $mainClass .= ' blockspare-block-animation ';
16 } else {
17 $mainClass .= ' ';
18 }
19 $mainClass .= $attributes['animation'] . ' ' . $attributes['blockHoverEffect'];
20
21 $separator = ',';
22
23 $alignclass = blockspare_checkalignment($attributes['align'], $attributes);
24
25 $dateClass = 'bs-date-time bs-date-wrapper blockspare-hover-item';
26 if ($attributes['layoutOption'] == 'date-time-style-1') {
27 $dateClass .= ' blockspare-hover-text ';
28 }
29
30 $timeClass = 'bs-date-time bs-time-wrapper blockspare-hover-item';
31 if ($attributes['layoutOption'] == 'date-time-style-1') {
32 $timeClass .= ' blockspare-hover-text ';
33 }
34 $date_format = date_i18n(get_option('date_format'), current_time('timestamp'));
35 ?>
36
37 <div class="<?php echo esc_attr($wrapperClass); ?> align<?php echo esc_attr($alignclass) ?>">
38 <?php echo blockspare_date_time_style_control($blockuniqueclass, $attributes); ?>
39 <div class="bs-date-time-widget <?php echo esc_attr($mainClass); ?>" bs-isenabled="<?php echo esc_attr($attributes['time']); ?>" bs-format="<?php echo esc_html($date_format); ?>">
40 <?php if ($attributes['date']) { ?>
41 <div class="<?php echo esc_attr($dateClass); ?>">
42 <?php if ($attributes['dateIconToggle']) { ?>
43 <div class='bs-icon-wrapper'>
44 <i class="bs-date-icon <?php echo esc_attr($attributes['dateIcon']); ?>" aria-hidden="true"></i>
45 </div>
46 <?php } ?>
47
48 <div class="bs-date">
49 <?php if ($attributes['textBeforeDate'] != '') { ?>
50 <span class="bs-before-date-text">
51 <?php echo esc_html($attributes['textBeforeDate']); ?>
52 </span>
53 <?php } ?>
54
55 <time class="bs-date-text" datetime="2025-10-27" aria-label="<?php echo esc_attr($date_format); ?>">
56 <?php echo esc_html($date_format); ?>
57 </time>
58 <?php if ($attributes['textAfterDate'] != '') { ?>
59 <span class="bs-after-date-text">
60 <?php echo esc_html($attributes['textAfterDate']); ?>
61 </span>
62 <?php } ?>
63 </div>
64 </div>
65 <?php } ?>
66
67 <div class="<?php echo esc_attr($timeClass); ?>" bs-isenabled="<?php echo esc_attr($attributes['time']); ?>" bs-format="<?php echo esc_html($date_format); ?>" id="bs-date-time">
68 <?php
69
70 if ($attributes['time']) {
71 if ($attributes['timeIconToggle']) { ?>
72 <div class="bs-icon-wrapper">
73 <i class="bs-time-icon <?php echo esc_attr($attributes['timeIcon']) ?>" aria-hidden="true"></i>
74 </div>
75 <?php }
76 } ?>
77 <span class="bs-time-text"></span>
78 </div>
79
80
81 </div>
82 </div>
83 <?php
84