Code Duplication    Length = 14-14 lines in 3 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
/**

extensions/blocks/google-calendar/google-calendar.php 1 location

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