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 / interactive-checklist / render.php

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

22 lines 832 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Interactive Checklist Block — server-side render.
4 *
5 * Emits only a wrapper carrying the block attributes as a JSON data-attribute.
6 * view.js hydrates it on the frontend with React (Components/Frontend/Checklist)
7 * and injects per-instance dynamic CSS (Components/Common/Style). Checked state
8 * persists per instance in localStorage.
9 *
10 * @package bBlocks
11 */
12
13 $id = wp_unique_id( 'bBlocksInteractiveChecklist-' );
14 $planClass = BBlocks\Inc\Utils::isPro() ? 'pro' : 'free';
15 ?>
16 <div
17 <?php // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- get_block_wrapper_attributes() is properly escaped ?>
18 <?php echo get_block_wrapper_attributes( [ 'class' => $planClass ] ); ?>
19 id='<?php echo esc_attr( $id ); ?>'
20 data-attributes='<?php echo esc_attr( wp_json_encode( $attributes ) ); ?>'
21 ></div>
22