| 1 |
<?php |
| 2 |
/** |
| 3 |
* Instagram block server-side render. |
| 4 |
* |
| 5 |
* Emits only an empty wrapper carrying the block attributes as JSON. The markup |
| 6 |
* is rendered on the client by view.js from the same shared component the editor |
| 7 |
* uses, matching the b-blocks convention (see image-hotspot / code-highlight). |
| 8 |
* |
| 9 |
* No credential is written here: the access token lives in a site option and the |
| 10 |
* feed is fetched through includes/Instagram.php. |
| 11 |
* |
| 12 |
* @package bBlocks |
| 13 |
*/ |
| 14 |
|
| 15 |
$prefix = 'b-blocks-instagram'; |
| 16 |
$id = empty( $attributes['blockId'] ) ? wp_unique_id( "$prefix-" ) : "$prefix-" . $attributes['blockId']; |
| 17 |
|
| 18 |
$planClass = BBlocks\Inc\Utils::isPro() ? 'pro' : 'free'; |
| 19 |
|
| 20 |
?> |
| 21 |
<div |
| 22 |
<?php // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- get_block_wrapper_attributes() is properly escaped ?> |
| 23 |
<?php echo get_block_wrapper_attributes([ 'class' => $planClass ]); ?> |
| 24 |
id='<?php echo esc_attr( $id ); ?>' |
| 25 |
data-attributes='<?php echo esc_attr( wp_json_encode( $attributes ) ); ?>' |
| 26 |
></div> |
| 27 |
|