Code Duplication    Length = 8-13 lines in 3 locations

extensions/blocks/instagram-gallery/instagram-gallery.php 1 location

@@ 24-31 (lines=8) @@
21
 * This is done via an action so that we can disable
22
 * registration if we need to.
23
 */
24
function register_block() {
25
	if ( ( defined( 'IS_WPCOM' ) && IS_WPCOM ) || Jetpack::is_active() ) {
26
		jetpack_register_block(
27
			BLOCK_NAME,
28
			array( 'render_callback' => __NAMESPACE__ . '\render_block' )
29
		);
30
	}
31
}
32
add_action( 'init', __NAMESPACE__ . '\register_block' );
33
34
/**

extensions/blocks/mailchimp/mailchimp.php 1 location

@@ 25-37 (lines=13) @@
22
 * This is done via an action so that we can disable
23
 * registration if we need to.
24
 */
25
function register_block() {
26
	if (
27
		( defined( 'IS_WPCOM' ) && IS_WPCOM )
28
		|| Jetpack::is_active()
29
	) {
30
		jetpack_register_block(
31
			BLOCK_NAME,
32
			array(
33
				'render_callback' => __NAMESPACE__ . '\load_assets',
34
			)
35
		);
36
	}
37
}
38
add_action( 'init', __NAMESPACE__ . '\register_block' );
39
40
/**

extensions/blocks/subscriptions/subscriptions.php 1 location

@@ 21-31 (lines=11) @@
18
 * This is done via an action so that we can disable
19
 * registration if we need to.
20
 */
21
function register_block() {
22
	if (
23
		( Jetpack::is_active() && Jetpack::is_module_active( 'subscriptions' ) )
24
		|| ( defined( 'IS_WPCOM' ) && IS_WPCOM )
25
	) {
26
		jetpack_register_block(
27
			BLOCK_NAME,
28
			array( 'render_callback' => __NAMESPACE__ . '\render_block' )
29
		);
30
	}
31
}
32
add_action( 'init', __NAMESPACE__ . '\register_block' );
33
34
/**