Code Duplication    Length = 14-14 lines in 2 locations

extensions/blocks/calendly/calendly.php 1 location

@@ 57-70 (lines=14) @@
54
 * Set the availability of the block as the editor
55
 * is loaded
56
 */
57
function set_availability() {
58
	if ( is_available() ) {
59
		\Jetpack_Gutenberg::set_extension_available( BLOCK_NAME );
60
	} else {
61
		\Jetpack_Gutenberg::set_extension_unavailable(
62
			BLOCK_NAME,
63
			'missing_plan',
64
			array(
65
				'required_feature' => 'calendly',
66
				'required_plan'    => 'value_bundle',
67
			)
68
		);
69
	}
70
}
71
add_action( 'init', 'Jetpack\Calendly_Block\set_availability' );
72
73
/**

extensions/blocks/opentable/opentable.php 1 location

@@ 57-70 (lines=14) @@
54
 * Set the availability of the block as the editor
55
 * is loaded.
56
 */
57
function set_availability() {
58
	if ( is_available() ) {
59
		\Jetpack_Gutenberg::set_extension_available( BLOCK_NAME );
60
	} else {
61
		\Jetpack_Gutenberg::set_extension_unavailable(
62
			BLOCK_NAME,
63
			'missing_plan',
64
			array(
65
				'required_feature' => 'opentable',
66
				'required_plan'    => 'premium-plan',
67
			)
68
		);
69
	}
70
}
71
add_action( 'jetpack_register_gutenberg_extensions', 'Jetpack\OpenTable_Block\set_availability' );
72
73
/**