| 1 |
<?php |
| 2 |
/** |
| 3 |
* Stat Cards 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/StatCards) |
| 7 |
* and injects per-instance dynamic CSS (Components/Common/Style). |
| 8 |
* |
| 9 |
* @package bBlocks |
| 10 |
*/ |
| 11 |
|
| 12 |
$id = wp_unique_id( 'bBlocksStatCards-' ); |
| 13 |
$planClass = BBlocks\Inc\Utils::isPro() ? 'pro' : 'free'; |
| 14 |
?> |
| 15 |
<div |
| 16 |
<?php // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- get_block_wrapper_attributes() is properly escaped ?> |
| 17 |
<?php echo get_block_wrapper_attributes( [ 'class' => $planClass ] ); ?> |
| 18 |
id='<?php echo esc_attr( $id ); ?>' |
| 19 |
data-attributes='<?php echo esc_attr( wp_json_encode( $attributes ) ); ?>' |
| 20 |
></div> |
| 21 |
|