Code Duplication    Length = 14-14 lines in 2 locations

extensions/blocks/calendly/calendly.php 1 location

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

extensions/blocks/opentable/opentable.php 1 location

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