@@ 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 | /** |
@@ 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 | /** |