Completed
Push — fix/hello-dolly-strikes-back ( 4b7047 )
by Jeremy
07:39
created

blocks.php ➔ jetpack_map_block_load_assets()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 2
dl 0
loc 9
rs 9.9666
c 0
b 0
f 0
1
<?php
2
/**
3
 * Load code specific to Gutenberg blocks which are not tied to a module.
4
 * This file is unusual, and is not an actual `module` as such.
5
 * It is included in ./module-extras.php
6
 *
7
 */
8
9
jetpack_register_block(
10
	'map',
11
	array(
12
		'render_callback' => 'jetpack_map_block_load_assets',
13
	)
14
);
15
16
/**
17
 * Map block registration/dependency declaration.
18
 *
19
 * @param array  $attr - Array containing the map block attributes.
20
 * @param string $content - String containing the map block content.
21
 *
22
 * @return string
23
 */
24
function jetpack_map_block_load_assets( $attr, $content ) {
25
	$dependencies = array(
26
		'wp-element',
27
		'wp-i18n',
28
		'wp-api-fetch',
29
	);
30
	Jetpack_Gutenberg::load_assets_as_required( 'map', $dependencies );
31
	return $content;
32
}
33