Code Duplication    Length = 13-15 lines in 4 locations

extensions/blocks/conversation/conversation.php 1 location

@@ 23-37 (lines=15) @@
20
 * This is done via an action so that we can disable
21
 * registration if we need to.
22
 */
23
function register_block() {
24
	$deprecated = function_exists( 'gutenberg_get_post_from_context' );
25
	$provides   = $deprecated ? 'providesContext' : 'provides_context';
26
27
	Blocks::jetpack_register_block(
28
		BLOCK_NAME,
29
		array(
30
			'render_callback' => __NAMESPACE__ . '\render_block',
31
			$provides         => array(
32
				'jetpack/conversation-participants'   => 'participants',
33
				'jetpack/conversation-showTimestamps' => 'showTimestamps',
34
			),
35
		)
36
	);
37
}
38
add_action( 'init', __NAMESPACE__ . '\register_block' );
39
40
/**

extensions/blocks/dialogue/dialogue.php 1 location

@@ 23-36 (lines=14) @@
20
 * This is done via an action so that we can disable
21
 * registration if we need to.
22
 */
23
function register_block() {
24
	$deprecated = function_exists( 'gutenberg_get_post_from_context' );
25
	$uses       = $deprecated ? 'context' : 'uses_context';
26
	Blocks::jetpack_register_block(
27
		BLOCK_NAME,
28
		array(
29
			'render_callback' => __NAMESPACE__ . '\render_block',
30
			$uses             => array(
31
				'jetpack/conversation-participants',
32
				'jetpack/conversation-showTimestamps',
33
			),
34
		)
35
	);
36
}
37
add_action( 'init', __NAMESPACE__ . '\register_block' );
38
39
/**

extensions/blocks/premium-content/logged-out-view/logged-out-view.php 1 location

@@ 22-34 (lines=13) @@
19
 * This is done via an action so that we can disable
20
 * registration if we need to.
21
 */
22
function register_loggedout_view_block() {
23
	// Determine required `context` key based on Gutenberg version.
24
	$deprecated = function_exists( 'gutenberg_get_post_from_context' );
25
	$uses       = $deprecated ? 'context' : 'uses_context';
26
27
	Blocks::jetpack_register_block(
28
		LOGGEDOUT_VIEW_NAME,
29
		array(
30
			'render_callback' => __NAMESPACE__ . '\render_loggedout_view_block',
31
			$uses             => array( 'premium-content/planId' ),
32
		)
33
	);
34
}
35
add_action( 'init', __NAMESPACE__ . '\register_loggedout_view_block' );
36
37
/**

extensions/blocks/premium-content/subscriber-view/subscriber-view.php 1 location

@@ 22-34 (lines=13) @@
19
 * This is done via an action so that we can disable
20
 * registration if we need to.
21
 */
22
function register_subscriber_view_block() {
23
	// Determine required `context` key based on Gutenberg version.
24
	$deprecated = function_exists( 'gutenberg_get_post_from_context' );
25
	$uses       = $deprecated ? 'context' : 'uses_context';
26
27
	Blocks::jetpack_register_block(
28
		SUBSCRIBER_VIEW_NAME,
29
		array(
30
			'render_callback' => __NAMESPACE__ . '\render_subscriber_view_block',
31
			$uses             => array( 'premium-content/planId' ),
32
		)
33
	);
34
}
35
add_action( 'init', __NAMESPACE__ . '\register_subscriber_view_block' );
36
37
/**