| 1 |
<?php |
| 2 |
/** |
| 3 |
* Slideshow Block. |
| 4 |
* |
| 5 |
* @since 7.1.0 |
| 6 |
* |
| 7 |
* @package Jetpack |
| 8 |
*/ |
| 9 |
|
| 10 |
jetpack_register_block( |
| 11 |
'jetpack/slideshow', |
| 12 |
array( |
| 13 |
'render_callback' => 'jetpack_slideshow_block_load_assets', |
| 14 |
) |
| 15 |
); |
| 16 |
|
| 17 |
/** |
| 18 |
* Slideshow block registration/dependency declaration. |
| 19 |
* |
| 20 |
* @param array $attr Array containing the slideshow block attributes. |
| 21 |
* @param string $content String containing the slideshow block content. |
| 22 |
* |
| 23 |
* @return string |
| 24 |
*/ |
| 25 |
function jetpack_slideshow_block_load_assets( $attr, $content ) { |
| 26 |
$dependencies = array( |
| 27 |
'lodash', |
| 28 |
'wp-escape-html', |
| 29 |
'wp-polyfill', |
| 30 |
); |
| 31 |
|
| 32 |
Jetpack_Gutenberg::load_assets_as_required( 'slideshow', $dependencies ); |
| 33 |
|
| 34 |
return $content; |
| 35 |
} |
| 36 |
|