PluginProbe
bBlocks – Essential Gutenberg Blocks & Patterns Collection / trunk
bBlocks – Essential Gutenberg Blocks & Patterns Collection vtrunk
2.1.6 2.1.5 2.1.4 2.1.3 2.1.2 2.1.1 2.1.0 2.0.43 2.0.42 2.0.41 2.0.40 2.0.39 2.0.38 trunk 1.0 1.1 1.2 1.3 1.4 1.5 1.5.1 1.5.2 1.5.3 1.5.4 1.5.5 All 106 releases
b-blocks / build / container / render.php

render.php in bBlocks – Essential Gutenberg Blocks & Patterns Collection trunk, at build/container/render.php

61 lines 2.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 $prefix = 'bBlocksContainer';
3 $id = wp_unique_id( "$prefix-" );
4
5 use BBlocks\Inc\Utils as Utils;
6 $planClass = Utils::isPro() ? 'pro' : 'free';
7
8 $innerBlocks = $content;
9
10 extract( $attributes );
11 extract( $content );
12
13 $mainSl = "#$id .$prefix";
14 $cSl = "$mainSl .$prefix" . "Content";
15
16 $bBlocksContainerCSS = "
17 #$id{
18 min-height: " . Utils::valForZero( $wrapper['minHeight'] ) . ";
19 }
20 $mainSl{
21 align-items: $horizontalAlign;
22 justify-content: $verticalAlign;
23 }
24 $cSl{
25 width: " . ( $isFullWidth ? '100%' : Utils::valForZero( $width['desktop'], '100%' ) ) . ";
26 flex-grow: $height;
27 }
28 @media only screen and (min-width:641px) and (max-width: 1024px){
29 $cSl{
30 width: " . ( $isFullWidth ? '100%' : Utils::valForZero( $width['tablet'], '100%' ) ) . ";
31 }
32 }
33 @media only screen and (max-width: 640px){
34 $cSl{
35 width: " . ( $isFullWidth ? '100%' : Utils::valForZero( $width['mobile'], '100%' ) ) . ";
36 }
37 }
38 ";
39
40 ?>
41
42 <div
43 <?php // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- get_block_wrapper_attributes() is properly escaped ?>
44 <?php echo get_block_wrapper_attributes(); ?> id='<?php echo esc_attr( $id ) ?>' data-attributes='<?php echo esc_attr( wp_json_encode( $attributes ) ); ?>' data-bblocks-advanced='<?php echo esc_attr( wp_json_encode( $attributes['advanced'] ) ); ?>'
45 >
46 <style><?php echo esc_html( $bBlocksContainerCSS ); ?></style>
47
48 <div class='<?php echo esc_attr( $prefix ) ?>'>
49 <?php if( $shape['top']['uploadSvg']['url'] || 'none' !== $shape['top']['type'] ){ ?>
50 <div class='shaped topShaped'></div>
51 <?php } ?>
52
53 <div class='<?php echo esc_attr( $prefix ) ?>Content is-layout-constrained wp-block-b-blocks-container-is-layout-constrained'>
54 <?php echo wp_kses( $innerBlocks, Utils::allowedInnerHTML() ); ?>
55 </div>
56
57 <?php if( $shape['bottom']['uploadSvg']['url'] || 'none' !== $shape['bottom']['type'] ){ ?>
58 <div class='shaped bottomShaped'></div>
59 <?php } ?>
60 </div>
61 </div>