| 1 |
<?php |
| 2 |
/** |
| 3 |
* Article Card block server-side render. |
| 4 |
* |
| 5 |
* Following the bplugins convention (see image-hotspot), the server only emits |
| 6 |
* an empty wrapper carrying the block attributes as JSON. React hydrates the |
| 7 |
* card on the frontend via view.js. |
| 8 |
* |
| 9 |
* @package bBlocks |
| 10 |
* |
| 11 |
* @var array $attributes Block attributes. |
| 12 |
* @var WP_Block $block Block instance. |
| 13 |
*/ |
| 14 |
|
| 15 |
$id = wp_unique_id( 'article-card-' ); |
| 16 |
?> |
| 17 |
<div |
| 18 |
<?php // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- get_block_wrapper_attributes() is properly escaped ?> |
| 19 |
<?php echo get_block_wrapper_attributes(); ?> |
| 20 |
id='<?php echo esc_attr( $id ); ?>' |
| 21 |
data-attributes='<?php echo esc_attr( wp_json_encode( $attributes ) ); ?>' |
| 22 |
></div> |
| 23 |
|