# b-blocks/2.1.0/build/posts/render.php

bBlocks – Essential Gutenberg Blocks &amp; Patterns Collection, version 2.1.0. 36 lines.

- Page: https://pluginprobe.com/plugins/b-blocks/2.1.0/code/build/posts/render.php
- Raw: https://pluginprobe.com/plugins/b-blocks/2.1.0/raw/build/posts/render.php
- Modified: 2026-07-27T10:48:26+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/2.1.0/code/build/posts/render.php#L10-L20`.

```php
<?php
$prefix = 'bBlocksPosts';
$id = wp_unique_id( "$prefix-" );
$planClass = BBlocks\Inc\Utils::isPro() ? 'pro' : 'free';

use BBlocks\Inc\Posts\Posts as Posts;

extract( $attributes );

if( 'ticker' === $layout ){
	wp_enqueue_script( 'easyTicker' );
}

$allPosts = get_posts( array_merge( Posts::query( $attributes ), [ 'posts_per_page' => -1 ] ) );

$skeletonAllowedTags = [
	'style'		=> [],
	'div'		=> [ 'class' => [], 'id' => [] ],
	'article'	=> [ 'class' => [] ],
	'span'		=> [ 'class' => [] ],
];
?>
<div
	<?php // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- get_block_wrapper_attributes() is properly escaped ?>
	<?php echo get_block_wrapper_attributes( [ 'class' => "$planClass align$align" ] ); ?>
	id='<?php echo esc_attr( $id ); ?>'
	data-nonce='<?php echo esc_attr( wp_json_encode( wp_create_nonce( 'wp_ajax' ) ) ); ?>'
	data-attributes='<?php echo esc_attr( wp_json_encode( $attributes ) ); ?>'
	data-extra='<?php echo esc_attr( wp_json_encode( [ 'totalPosts' => count( $allPosts ) ] ) ); ?>'
>
	<pre id='firstPosts' style='display: none;'>
		<?php echo esc_html( wp_json_encode( Posts::getPosts( $attributes ) ) ) ?>
	</pre>

	<?php echo wp_kses( Posts::loadingPlaceholder( $attributes, $prefix ), $skeletonAllowedTags ); ?>
</div>
```
