| 1 |
<?php |
| 2 |
/** |
| 3 |
* Expand Content block server-side render. |
| 4 |
* |
| 5 |
* Follows the data-table convention: the wrapper only carries the block id and |
| 6 |
* a JSON snapshot of the attributes. view.js mounts a React root on the wrapper |
| 7 |
* and the Frontend component (ExpandContent.js) moves the InnerBlocks content |
| 8 |
* ($content) out of the template container into its own tree. |
| 9 |
* |
| 10 |
* @package bBlocks |
| 11 |
*/ |
| 12 |
|
| 13 |
$id = wp_unique_id( 'bBlocksExpandContent-' ); |
| 14 |
?> |
| 15 |
|
| 16 |
<div <?php echo get_block_wrapper_attributes(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- get_block_wrapper_attributes() is properly escaped. ?> id='<?php echo esc_attr( $id ); ?>' data-attributes='<?php echo esc_attr( wp_json_encode( $attributes ) ); ?>'> |
| 17 |
|
| 18 |
<div class="b-blocks-expand-content-innerBlocks-contents"> |
| 19 |
<?php |
| 20 |
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- $content is rendered InnerBlocks output already escaped by core. |
| 21 |
echo $content; |
| 22 |
?> |
| 23 |
</div> |
| 24 |
</div> |
| 25 |
|