PluginProbe
BlockSpare – Gutenberg Blocks, AI Content Generator & Site Builder for News, Magazine & Blogs / 2.7.3
BlockSpare – Gutenberg Blocks, AI Content Generator & Site Builder for News, Magazine & Blogs v2.7.3
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
← All changes | inc/latest-post-block/posts-flash/index.php +114 -37 2.5.3 → 2.7.3 View file →
@@ -109,9 +109,13 @@
109 109 $block_post_wrap = $blockuniqueclass . ' blockspare-posts-block-post-wrap';
110 110 $count = 0;
111 111 $layout_class = 'bs-flash-wrap flash-layout ' . $attributes['layoutStyle'];
112 112
113 - $exclusive_posts = 'bs-exclusive-posts';
113 + if($attributes['fixedWidth']) {
114 + $layout_class .= ' has-fixed-width';
115 + }
116 +
117 + $exclusive_posts = 'bs-exclusive-posts blockspare-hover-item';
114 118 if($attributes['border']){
115 119 $exclusive_posts .= ' bs-border-enabled bs-' . $attributes['borderStyle'];
116 120 } else {
117 121 $exclusive_posts .= ' bs-border-disabled';
@@ -122,36 +126,37 @@
122 126 }else{
123 127 $flash_spiner_class .= $attributes['animationStyle'];
124 128 }
125 129 $spinner_icon = $attributes['spinnerIcon'];
126 - $marquee_class = 'marquee bs-flash-side ' . $attributes['direction'];
130 + $marquee_class = 'bs-marquee bs-flash-side ' . $attributes['direction'];
127 131 if($attributes['pauseOnHover']){
128 132 $marquee_class .= ' pause-on-hover';
129 133 }
130 134 ?>
131 135
132 -<div class="<?php echo esc_attr($class);?>">
136 +<div class="<?php echo esc_attr($class);?> <?php echo esc_attr($attributes['blockHoverEffect']) ?>">
137 +<?php echo latest_posts_style_control_flash($blockuniqueclass ,$attributes);?>
133 138 <section class="<?php echo esc_attr($block_post_wrap);?>">
134 139 <div class="<?php echo esc_attr($layout_class);?>">
135 140 <div class="<?php echo esc_attr($exclusive_posts);?>">
136 141 <div class="bs-exclusive-now">
137 - <?php if($attributes['exclusiveSubtitle']){?>
138 - <span class="bs-exclusive-news-title"><?php echo esc_html($attributes['exclusiveSubtitleText']); ?></span>
139 - <?php }?>
142 + <?php if($attributes['exclusiveSubtitle']){ ?>
143 + <span class="bs-exclusive-news-title"><span><?php echo esc_html($attributes['exclusiveSubtitleText']); ?></span></span>
144 + <?php } ?>
140 145 <div class="bs-exclusive-now-txt-animation-wrap">
141 - <?php if($attributes['spinner']){?>
146 + <?php if($attributes['spinner']){ ?>
142 147 <span class="<?php echo esc_attr($flash_spiner_class); ?>">
143 - <?php if($attributes['spinnerOption'] == 'spinner-option-1') {?>
148 + <?php if($attributes['spinnerOption'] == 'spinner-option-1') { ?>
144 149 <div class="ring"></div>
145 150 <div class="ring"></div>
146 151 <div class="ring"></div>
147 152 <div class="ring"></div>
148 153 <div class="ring"></div>
149 - <?php } else {?>
154 + <?php } else { ?>
150 155 <i class="<?php echo esc_attr($spinner_icon);?>"></i>
151 - <?php }?>
156 + <?php } ?>
152 157 </span>
153 - <?php }?>
158 + <?php } ?>
154 159 <span class="bs-exclusive-texts-wrapper">
155 160 <?php echo $attributes['exclusiveText'] != "" ? $attributes['exclusiveText'] : "Breaking News";?>
156 161 </span>
157 162 </div>
@@ -180,19 +185,19 @@
180 185 <?php
181 186
182 187 if (!empty($attributes['imageSize'])) {
183 188 $post_thumb_size = 'thumbnail ';
184 - }?>
189 + } ?>
185 190 <a href="<?php echo esc_url(get_permalink($post_id));?>" rel="bookmark" aria-hidden="true"
186 191 tabindex="-1">
187 192 <span class="bs-circle-marq">
188 - <?php if($attributes['enableCount']){?>
193 + <?php if($attributes['enableCount']){ ?>
189 194 <span class="bs-trending-no"><?php echo esc_html( $count );?></span>
190 - <?php }?>
195 + <?php } ?>
191 196 <?php
192 197 if(has_post_thumbnail($post_id)){
193 198 echo wp_kses_post(wp_get_attachment_image($post_thumb_id, $post_thumb_size));
194 - }else{?>
199 + }else{ ?>
195 200 <div class="bs-no-thumbnail-img"> </div>
196 201 <?php } ?>
197 202 </span>
198 203 <span class="bs-post-title">
@@ -202,15 +207,67 @@
202 207 if (!$title) {
203 208 $title = __('Untitled', 'blockspare');
204 209 }
205 210
206 - echo esc_html($title);
211 + echo ($title);
207 212 ?>
208 213 </span>
209 214 </a>
210 215 </h4>
211 - <?php }?>
216 + <?php } ?>
212 217 </div>
218 + <div aria-hidden="true" class="bs-marquee-wrapper">
219 + <?php while ($grid_query->have_posts()) {
220 + $grid_query->the_post();
221 +
222 + $count++;
223 +
224 + /* Setup the post ID */
225 + $post_id = get_the_ID();
226 +
227 + /* Setup the featured image ID */
228 + $post_thumb_id = get_post_thumbnail_id($post_id);
229 +
230 +
231 + /* Setup the post classes */
232 + $post_classes = 'bs-post-title ';
233 +
234 + ?>
235 +
236 + <h4 class="<?php echo esc_attr($post_classes) ?>">
237 + <?php
238 +
239 + if (!empty($attributes['imageSize'])) {
240 + $post_thumb_size = 'thumbnail ';
241 + } ?>
242 + <a href="<?php echo esc_url(get_permalink($post_id));?>" rel="bookmark" aria-hidden="true"
243 + tabindex="-1">
244 + <span class="bs-circle-marq">
245 + <?php if($attributes['enableCount']){ ?>
246 + <span class="bs-trending-no"><?php echo esc_html( $count );?></span>
247 + <?php } ?>
248 + <?php
249 + if(has_post_thumbnail($post_id)){
250 + echo wp_kses_post(wp_get_attachment_image($post_thumb_id, $post_thumb_size));
251 + }else{ ?>
252 + <div class="bs-no-thumbnail-img"> </div>
253 + <?php } ?>
254 + </span>
255 + <span class="bs-post-title">
256 + <?php
257 + $title = get_the_title($post_id);
258 +
259 + if (!$title) {
260 + $title = __('Untitled', 'blockspare');
261 + }
262 +
263 + echo ($title);
264 + ?>
265 + </span>
266 + </a>
267 + </h4>
268 + <?php } ?>
269 + </div>
213 270 </div>
214 271 </div>
215 272 </div>
216 273 </div>
@@ -216,11 +273,10 @@
216 273 </div>
217 274 </section>
218 275 </div>
219 276 <?php wp_reset_postdata();
220 - $data_content = latest_posts_style_control_flash($blockuniqueclass ,$attributes);
221 - $data_content .= ob_get_clean();
222 - return $data_content;
277 +
278 + return ob_get_clean();
223 279 }
224 280 }
225 281 }
226 282
@@ -257,22 +313,16 @@
257 313
258 314
259 315
260 316
261 - if(!function_exists('latest_posts_style_control_flash')){
262 - function latest_posts_style_control_flash($blockuniqueclass ,$attributes)
263 - {
317 +if(!function_exists('latest_posts_style_control_flash')){
318 + function latest_posts_style_control_flash($blockuniqueclass ,$attributes){
264 319
265 320 $boxshadowcss = '';
266 321
267 -
268 -
269 -
270 -
271 322 $block_content = '';
272 323 $block_content .= '<style type="text/css">';
273 324
274 -
275 325 //post-flash-background
276 326 if($attributes['background']) {
277 327 $block_content .= ' .' . $blockuniqueclass . ' .bs-flash-wrap .bs-exclusive-posts{
278 328 background-color:' . $attributes['backGroundColor'] . ';
@@ -279,11 +329,17 @@
279 329 }';
280 330 }
281 331
282 332 //post-flash-border-radius
283 - $block_content .= ' .' . $blockuniqueclass . ' .bs-flash-wrap .bs-exclusive-posts, .bs-flash-wrap .bs-exclusive-posts .bs-exclusive-now-txt-animation-wrap, .bs-flash-wrap .bs-exclusive-posts .bs-exclusive-slides{
333 + $block_content .= ' .' . $blockuniqueclass . ' .bs-flash-wrap .bs-exclusive-posts{
284 334 border-radius:' . $attributes['borderRadius'] . 'px;
285 335 }';
336 + $block_content .= ' .' . $blockuniqueclass . ' .bs-flash-wrap .bs-exclusive-posts .bs-exclusive-now-txt-animation-wrap{
337 + border-radius:' . $attributes['borderRadius'] . 'px;
338 + }';
339 + $block_content .= ' .' . $blockuniqueclass . ' .bs-flash-wrap .bs-exclusive-posts .bs-exclusive-slides{
340 + border-radius:' . $attributes['borderRadius'] . 'px;
341 + }';
286 342
287 343 //post-image-border-radius
288 344 $block_content .= ' .' . $blockuniqueclass . ' .bs-flash-wrap .bs-exclusive-posts .bs-exclusive-slides .bs-circle-marq{
289 345 border-radius:' . $attributes['imgBorderRadius'] . 'px;
@@ -289,12 +345,17 @@
289 345 border-radius:' . $attributes['imgBorderRadius'] . 'px;
290 346 }';
291 347
292 348 //post-flash-animation-speed
293 - $block_content .= ' .' . $blockuniqueclass . ' .bs-flash-wrap .bs-exclusive-posts .bs-exclusive-slides .marquee .bs-marquee-wrapper{
294 - animation-duration:' . $attributes['animationSpeed'] . 'ms;
349 + $block_content .= ' .' . $blockuniqueclass . ' .bs-flash-wrap .bs-exclusive-posts .bs-exclusive-slides .bs-marquee .bs-marquee-wrapper{
350 + animation-duration:' . $attributes['animationSpeed'] . 's;
295 351 }';
296 352
353 + //post-widht
354 + $block_content .= ' .' . $blockuniqueclass . ' .bs-flash-wrap.has-fixed-width h4.bs-post-title{
355 + width:' . $attributes['postWidth'] . 'px;
356 + }';
357 +
297 358 //Title color
298 359 $block_content .= ' .' . $blockuniqueclass . ' .bs-flash-wrap .bs-exclusive-posts .bs-exclusive-slides a .bs-post-title{
299 360 color:' . $attributes['postTitleColor'] . ';
300 361 }';
@@ -311,11 +372,14 @@
311 372 }';
312 373 $block_content .= ' .' . $blockuniqueclass . ' .bs-flash-wrap.flash-style-2 .bs-exclusive-posts .bs-exclusive-now .bs-exclusive-now-txt-animation-wrap::after{
313 374 border-left-color:' . $attributes['newsBgColor'] . ';
314 375 }';
315 - $block_content .= ' .' . $blockuniqueclass . ' .bs-flash-wrap.flash-style-3 .bs-exclusive-posts .bs-exclusive-now .bs-exclusive-now-txt-animation-wrap::after, .bs-flash-wrap.flash-style-4 .bs-exclusive-posts .bs-exclusive-now .bs-exclusive-now-txt-animation-wrap::after{
376 + $block_content .= ' .' . $blockuniqueclass . ' .bs-flash-wrap.flash-style-3 .bs-exclusive-posts .bs-exclusive-now .bs-exclusive-now-txt-animation-wrap::after{
316 377 background-color:' . $attributes['newsBgColor'] . ';
317 378 }';
379 + $block_content .= ' .' . $blockuniqueclass . ' .bs-flash-wrap.flash-style-4 .bs-exclusive-posts .bs-exclusive-now .bs-exclusive-now-txt-animation-wrap::after{
380 + background-color:' . $attributes['newsBgColor'] . ';
381 + }';
318 382
319 383 //Border
320 384 if($attributes['border']) {
321 385 $block_content .= ' .' . $blockuniqueclass . ' .bs-flash-wrap .bs-exclusive-posts{
@@ -343,8 +407,11 @@
343 407 margin-top:' . $attributes['marginTop'] . 'px;
344 408 margin-right:' . $attributes['marginRight'] . 'px;
345 409 margin-bottom:' . $attributes['marginBottom'] . 'px;
346 410 margin-left:' . $attributes['marginLeft'] . 'px;
411 + }';
412 +
413 + $block_content .= ' .' . $blockuniqueclass . ' .bs-flash-wrap .bs-exclusive-slides{
347 414 padding-top:' . $attributes['paddingTop'] . 'px;
348 415 padding-right:' . $attributes['paddingRight'] . 'px;
349 416 padding-bottom:' . $attributes['paddingBottom'] . 'px;
350 417 padding-left:' . $attributes['paddingLeft'] . 'px;
@@ -351,28 +418,33 @@
351 418 }';
352 419
353 420 // Post Number Color
354 421 if($attributes['enableCount']){
355 - $block_content .= ' .' . $blockuniqueclass . ' .bs-flash-wrap .bs-exclusive-posts .bs-exclusive-slides .marquee h4.bs-post-title a .bs-circle-marq .bs-trending-no{
422 + $block_content .= ' .' . $blockuniqueclass . ' .bs-flash-wrap .bs-exclusive-posts .bs-exclusive-slides .bs-marquee h4.bs-post-title a .bs-circle-marq .bs-trending-no{
356 423 color: ' . $attributes['countColor'] . ';
357 424 }';
358 425 }
359 426
360 -
361 -
362 427 //Font Settings
363 428
364 429 $block_content .= ' .' . $blockuniqueclass . ' .bs-flash-wrap .bs-exclusive-posts .bs-exclusive-slides a .bs-post-title{
365 430 font-size: ' . $attributes['postTitleFontSize'] . $attributes['titleFontSizeType'] . ';
366 431 '.bscheckFontfamily($attributes['titleFontFamily']).';
367 - font-weight: ' . $attributes['titleFontWeight'] . ';
432 + '.bscheckFontfamilyWeight($attributes['titleFontWeight']).';
433 + line-height: ' . $attributes['postTitleLineHeight'] . ';
368 434 }';
369 435
370 436 $block_content .= ' .' . $blockuniqueclass . ' .bs-flash-wrap .bs-exclusive-now .bs-exclusive-now-txt-animation-wrap .bs-exclusive-texts-wrapper{
371 437 font-size: ' . $attributes['exclusiveFontSize'] . $attributes['exclusiveFontSizeType'] . ';
372 438 '.bscheckFontfamily($attributes['exclusiveFontFamily']).';
373 - font-weight: ' . $attributes['exclusiveFontWeight'] . ';
439 + '.bscheckFontfamilyWeight($attributes['exclusiveFontWeight']).';
374 440 }';
441 +
442 + $block_content .= ' .' . $blockuniqueclass . ' .bs-flash-wrap .bs-exclusive-now .bs-exclusive-news-title{
443 + font-size: ' . $attributes['exclusiveSubtitleFontSize'] . $attributes['exclusiveSubtitleFontSizeType'] . ';
444 + '.bscheckFontfamily($attributes['exclusiveSubtitleFontFamily']).';
445 + '.bscheckFontfamilyWeight($attributes['exclusiveSubtitleFontWeight']).';
446 + }';
375 447
376 448 $block_content .= '@media (max-width: 1025px) { ';
377 449 $block_content .= ' .' . $blockuniqueclass . ' .bs-flash-wrap .bs-exclusive-posts .bs-exclusive-slides a .bs-post-title{
378 450 font-size: ' . $attributes['titleFontSizeTablet'] . $attributes['titleFontSizeType'] . ';
@@ -379,8 +451,11 @@
379 451 }';
380 452 $block_content .= ' .' . $blockuniqueclass . ' .bs-flash-wrap .bs-exclusive-now .bs-exclusive-now-txt-animation-wrap .bs-exclusive-texts-wrapper{
381 453 font-size: ' . $attributes['exclusiveFontSizeTablet'] . $attributes['exclusiveFontSizeType'] . ';
382 454 }';
455 + $block_content .= ' .' . $blockuniqueclass . ' .bs-flash-wrap .bs-exclusive-now .bs-exclusive-news-title{
456 + font-size: ' . $attributes['exclusiveSubtitleFontSizeTablet'] . $attributes['exclusiveSubtitleFontSizeType'] . ';
457 + }';
383 458 $block_content .= '}';
384 459
385 460 $block_content .= '@media (max-width: 767px) { ';
386 461 $block_content .= ' .' . $blockuniqueclass . ' .bs-flash-wrap .bs-exclusive-posts .bs-exclusive-slides a .bs-post-title{
@@ -387,8 +462,10 @@
387 462 font-size: ' . $attributes['titleFontSizeMobile'] . $attributes['titleFontSizeType'] . ';
388 463 }';
389 464 $block_content .= ' .' . $blockuniqueclass . ' .bs-flash-wrap .bs-exclusive-now .bs-exclusive-now-txt-animation-wrap .bs-exclusive-texts-wrapper{
390 465 font-size: ' . $attributes['exclusiveFontSizeMobile'] . $attributes['exclusiveFontSizeType'] . ';
466 + }';$block_content .= ' .' . $blockuniqueclass . ' .bs-flash-wrap .bs-exclusive-now .bs-exclusive-news-title{
467 + font-size: ' . $attributes['exclusiveSubtitleFontSizeMobile'] . $attributes['exclusiveSubtitleFontSizeType'] . ';
391 468 }';
392 469 $block_content .= '}';
393 470
394 471 $block_content .= '</style>';