Completed
Push — update/mailchimp-ui-changes ( f4a7d6...e71283 )
by
unknown
11:27
created

slideshow.php ➔ jetpack_slideshow_block_load_assets()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 2
dl 0
loc 10
rs 9.9332
c 0
b 0
f 0
1
<?php
2
/**
3
 * Slideshow Block.
4
 *
5
 * @since 7.1.0
6
 *
7
 * @package Jetpack
8
 */
9
10
register_block_type(
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-element',
29
		'wp-i18n',
30
	);
31
	Jetpack_Gutenberg::load_assets_as_required( 'slideshow', $dependencies );
32
33
	return $content;
34
}
35