| @@ -1,29 +1,11 @@ | ||
| 1 | 1 | <?php |
| 2 | -/** | |
| 3 | - * Timeline Item Block server-side render. | |
| 4 | - * | |
| 5 | - * One entry on a Timeline: the card holding the inner blocks, the SVG marker | |
| 6 | - * that sits on the line, and the date beside it. Like its parent the markup is | |
| 7 | - * rendered here rather than on the client — the card's content is InnerBlocks | |
| 8 | - * — and view.js only mounts the generated <style> into the empty host below. | |
| 9 | - * | |
| 10 | - * The side an entry sits on is normally decided in CSS from its position in | |
| 11 | - * the list, so nothing about ordering needs to be known at render time. A | |
| 12 | - * `side` set in the sidebar adds a class that outranks that rule; it mirrors | |
| 13 | - * utils/functions.js. | |
| 14 | - * | |
| 15 | - * @package bBlocks | |
| 16 | - * | |
| 17 | - * @var array $attributes Block attributes. | |
| 18 | - * @var string $content Rendered inner blocks. | |
| 19 | - */ | |
| 20 | - | |
| 21 | 2 | if ( ! defined( 'ABSPATH' ) ) { |
| 22 | 3 | exit; |
| 23 | 4 | } |
| 24 | 5 | |
| 25 | -$id = wp_unique_id( 'timeline-item-' ); | |
| 6 | +$id = wp_unique_id( 'bBlocksTimelineItem-' ); | |
| 7 | +$attributes = BBlocks\Inc\Sanitize::attributes( $attributes ); | |
| 26 | 8 | |
| 27 | 9 | $item = isset( $attributes['item'] ) && is_array( $attributes['item'] ) ? $attributes['item'] : array(); |
| 28 | 10 | |
| 29 | 11 | $side = isset( $item['side'] ) ? sanitize_key( (string) $item['side'] ) : ''; |