# b-blocks/trunk/build/container/render.php

bBlocks – Essential Gutenberg Blocks &amp; Patterns Collection, version trunk. 61 lines.

- Page: https://pluginprobe.com/plugins/b-blocks/trunk/code/build/container/render.php
- Raw: https://pluginprobe.com/plugins/b-blocks/trunk/raw/build/container/render.php
- Modified: 2026-09-10T10:41:24+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/b-blocks/trunk/code/build/container/render.php#L10-L20`.

```php
<?php
$prefix = 'bBlocksContainer';
$id = wp_unique_id( "$prefix-" );

use BBlocks\Inc\Utils as Utils;
$planClass = Utils::isPro() ? 'pro' : 'free';

$innerBlocks = $content;

extract( $attributes );
extract( $content );

$mainSl = "#$id .$prefix";
$cSl = "$mainSl .$prefix" . "Content";

$bBlocksContainerCSS = "
	#$id{
		min-height: " . Utils::valForZero( $wrapper['minHeight'] ) . ";
	}
	$mainSl{
		align-items: $horizontalAlign;
		justify-content: $verticalAlign;
	}
	$cSl{
 		width: " . ( $isFullWidth ? '100%' : Utils::valForZero( $width['desktop'], '100%' ) ) . ";
		flex-grow: $height;
	}
	@media only screen and (min-width:641px) and (max-width: 1024px){
		$cSl{
			width: " . ( $isFullWidth ? '100%' : Utils::valForZero( $width['tablet'], '100%' ) ) . ";
		}
	}
	@media only screen and (max-width: 640px){
		$cSl{
			width: " . ( $isFullWidth ? '100%' : Utils::valForZero( $width['mobile'], '100%' ) ) . ";
		}
	}
";

?>

<div
	<?php // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- get_block_wrapper_attributes() is properly escaped ?>
	<?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'] ) ); ?>'
>
	<style><?php echo esc_html( $bBlocksContainerCSS ); ?></style>

	<div class='<?php echo esc_attr( $prefix ) ?>'>
		<?php if( $shape['top']['uploadSvg']['url'] || 'none' !== $shape['top']['type'] ){ ?>
			<div class='shaped topShaped'></div>
		<?php } ?>

		<div class='<?php echo esc_attr( $prefix ) ?>Content is-layout-constrained wp-block-b-blocks-container-is-layout-constrained'>
			<?php echo wp_kses( $innerBlocks, Utils::allowedInnerHTML() ); ?>
		</div>

		<?php if( $shape['bottom']['uploadSvg']['url'] || 'none' !== $shape['bottom']['type'] ){ ?>
			<div class='shaped bottomShaped'></div>
		<?php } ?>
	</div>
</div>
```
