# b-blocks/trunk/build/code-highlight/render.php

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

- Page: https://pluginprobe.com/plugins/b-blocks/trunk/code/build/code-highlight/render.php
- Raw: https://pluginprobe.com/plugins/b-blocks/trunk/raw/build/code-highlight/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/code-highlight/render.php#L10-L20`.

```php
<?php
/**
 * Code Highlight block server-side render.
 *
 * Emits only an empty wrapper carrying the block attributes as JSON. The markup
 * is rendered on the client by view.js from the same shared component the editor
 * uses, matching the b-blocks convention (see image-hotspot / infographic).
 *
 * @package bBlocks
 */

$prefix = 'b-blocks-code-highlight';
$id     = empty( $attributes['blockId'] ) ? wp_unique_id( "$prefix-" ) : "$prefix-" . $attributes['blockId'];

$planClass = BBlocks\Inc\Utils::isPro() ? 'pro' : 'free';

?>
<div
	<?php // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- get_block_wrapper_attributes() is properly escaped ?>
	<?php echo get_block_wrapper_attributes([ 'class' => $planClass ]); ?>
	id='<?php echo esc_attr( $id ); ?>'
	data-attributes='<?php echo esc_attr( wp_json_encode( $attributes ) ); ?>'
></div>

```
