PluginProbe
BlockSpare – Gutenberg Blocks for News, Magazine, Blog & Business Websites / trunk
BlockSpare – Gutenberg Blocks for News, Magazine, Blog & Business Websites vtrunk
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 2.6.1 All 38 releases
blockspare / build / block / latest-posts-express-grid / render.php

render.php in BlockSpare – Gutenberg Blocks for News, Magazine, Blog & Business Websites trunk, at build/block/latest-posts-express-grid/render.php

57 lines 1.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 $unq_class = mt_rand(100000, 999999);
3 $blockuniqueclass = '';
4
5 if (!empty($attributes['uniqueClass'])) {
6 $blockuniqueclass = $attributes['uniqueClass'];
7 } else {
8 $blockuniqueclass = 'blockspare-posts-block-list-' . $unq_class;
9 }
10
11 $design = 'blockspare-posts-block-latestpost-express-grid ';
12
13
14 $block_class = 'blockspare-posts-block-is-express' . ' has-gutter-' . $attributes['gutterSpace'];;;
15 if ($attributes['enableEqualHeight']) {
16 $block_class .= ' bs-has-equal-height';
17 }
18
19 if ($attributes['displaySpotLightExceprt']) {
20 $block_class .= ' has-spotlight-excerpt ';
21 }
22 $layoutClass = false;
23
24 if ($attributes['express'] != 'blockspare-posts-block-express-grid-layout-4' && $attributes['express'] != 'blockspare-posts-block-express-grid-layout-5' && $attributes['express'] != 'blockspare-posts-block-express-grid-layout-6') {
25 $layoutClass = true;
26 }
27
28 $design .= $attributes['express'];
29 $blockName = 'express';
30 $alignclass = blockspare_checkalignment($attributes['align'], $attributes);
31
32
33 /* Build the block classes */
34 $class = "wp-block-blockspare-posts-block-blockspare-posts-block-latest-posts align" . $alignclass . " " . $attributes['blockHoverEffect'] . " " . $attributes['imageHoverEffect'];
35
36 if (isset($attributes['className'])) {
37 $class .= ' ' . $attributes['className'];
38 }
39
40 if ($attributes['animation']) {
41 $class .= ' blockspare-block-animation';
42 }
43 $class .= ' ' . $blockuniqueclass;
44
45
46 ?>
47 <div class="<?php echo esc_attr($class); ?>" blockspare-animation="<?php echo esc_attr($attributes['animation']); ?>">
48 <?php
49 if (isset($attributes['enablePagination']) && $attributes['enablePagination']) {
50 wp_enqueue_script('block_pagination_script');
51 }
52 blockspare_latest_posts_style_control($blockuniqueclass, $attributes);
53 blockspare_epxpress_query_loop_and_wrapper($attributes, $block_class, $design, $blockName, $layoutClass);
54 ?>
55 </div>
56 <?php
57