| @@ -1,24 +1,11 @@ | ||
| 1 | 1 | <?php |
| 2 | -/** | |
| 3 | - * Google Map block server-side render. | |
| 4 | - * | |
| 5 | - * Emits an empty wrapper carrying the block attributes; view.js hydrates it | |
| 6 | - * with React (Components/Common/Style.js + Components/Frontend/GoogleMap.js). | |
| 7 | - * The API key is injected here as a data attribute so it never lives in post | |
| 8 | - * content, and a static address + deep link is printed inside the wrapper so | |
| 9 | - * no-JS / no-key visitors still get something useful before hydration wipes it. | |
| 10 | - * | |
| 11 | - * @package bBlocks | |
| 12 | - * | |
| 13 | - * @var array $attributes Block attributes. | |
| 14 | - */ | |
| 15 | 2 | |
| 16 | 3 | $prefix = 'bBlocksGoogleMap'; |
| 17 | 4 | $id = wp_unique_id( "$prefix-" ); |
| 18 | 5 | $api_keys = get_option( 'bBlocksApiKeys', [] ); |
| 19 | 6 | $planClass = BBlocks\Inc\Utils::isPro() ? 'pro' : 'free'; |
| 20 | - | |
| 7 | +$attributes = BBlocks\Inc\Sanitize::attributes( $attributes ); | |
| 21 | 8 | $source = isset( $attributes['source'] ) && is_array( $attributes['source'] ) ? $attributes['source'] : []; |
| 22 | 9 | $markers = isset( $attributes['markers'] ) && is_array( $attributes['markers'] ) ? $attributes['markers'] : []; |
| 23 | 10 | $caption = isset( $attributes['caption'] ) && is_array( $attributes['caption'] ) ? $attributes['caption'] : []; |
| 24 | 11 | |