Completed
Push — add/changelog-71 ( b70f6c...ac535c )
by Jeremy
10:29
created

contact-info.php ➔ jetpack_contact_info_block_load_assets()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 2
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * Contact Info block and its child blocks.
4
 *
5
 * @since 7.1.0
6
 *
7
 * @package Jetpack
8
 */
9
10
jetpack_register_block(
11
	'jetpack/contact-info',
12
	array(
13
		'render_callback' => 'jetpack_contact_info_block_load_assets',
14
	)
15
);
16
jetpack_register_block(
17
	'jetpack/email',
18
	array( 'parent' => array( 'jetpack/contact-info' ) )
19
);
20
jetpack_register_block(
21
	'jetpack/address',
22
	array( 'parent' => array( 'jetpack/contact-info' ) )
23
);
24
jetpack_register_block(
25
	'jetpack/phone',
26
	array( 'parent' => array( 'jetpack/contact-info' ) )
27
);
28
29
/**
30
 * Contact info block registration/dependency declaration.
31
 *
32
 * @param array  $attr    Array containing the contact info block attributes.
33
 * @param string $content String containing the contact info block content.
34
 *
35
 * @return string
36
 */
37
function jetpack_contact_info_block_load_assets( $attr, $content ) {
38
	Jetpack_Gutenberg::load_assets_as_required( 'contact-info' );
39
	return $content;
40
}
41