@@ 25-37 (lines=13) @@ | ||
22 | * This is done via an action so that we can disable |
|
23 | * registration if we need to. |
|
24 | */ |
|
25 | function register_block() { |
|
26 | if ( |
|
27 | ( defined( 'IS_WPCOM' ) && IS_WPCOM ) |
|
28 | || Jetpack::is_active() |
|
29 | ) { |
|
30 | jetpack_register_block( |
|
31 | BLOCK_NAME, |
|
32 | array( |
|
33 | 'render_callback' => __NAMESPACE__ . '\load_assets', |
|
34 | ) |
|
35 | ); |
|
36 | } |
|
37 | } |
|
38 | add_action( 'init', __NAMESPACE__ . '\register_block' ); |
|
39 | ||
40 | /** |
@@ 21-31 (lines=11) @@ | ||
18 | * This is done via an action so that we can disable |
|
19 | * registration if we need to. |
|
20 | */ |
|
21 | function register_block() { |
|
22 | if ( |
|
23 | ( defined( 'IS_WPCOM' ) && IS_WPCOM ) |
|
24 | || ( Jetpack::is_active() && Jetpack::is_module_active( 'subscriptions' ) ) |
|
25 | ) { |
|
26 | jetpack_register_block( |
|
27 | BLOCK_NAME, |
|
28 | array( 'render_callback' => __NAMESPACE__ . '\render_block' ) |
|
29 | ); |
|
30 | } |
|
31 | } |
|
32 | add_action( 'init', __NAMESPACE__ . '\register_block' ); |
|
33 | ||
34 | /** |
@@ 25-32 (lines=8) @@ | ||
22 | * This is done via an action so that we can disable |
|
23 | * registration if we need to. |
|
24 | */ |
|
25 | function register_block() { |
|
26 | if ( ( defined( 'IS_WPCOM' ) && IS_WPCOM ) || Jetpack::is_active() ) { |
|
27 | jetpack_register_block( |
|
28 | BLOCK_NAME, |
|
29 | array( 'render_callback' => __NAMESPACE__ . '\render_block' ) |
|
30 | ); |
|
31 | } |
|
32 | } |
|
33 | add_action( 'init', __NAMESPACE__ . '\register_block' ); |
|
34 | ||
35 | /** |
@@ 34-46 (lines=13) @@ | ||
31 | /** |
|
32 | * Register the block |
|
33 | */ |
|
34 | public static function register() { |
|
35 | if ( |
|
36 | ( defined( 'IS_WPCOM' ) && IS_WPCOM ) |
|
37 | || Jetpack::is_active() |
|
38 | ) { |
|
39 | jetpack_register_block( |
|
40 | self::BLOCK_NAME, |
|
41 | array( |
|
42 | 'render_callback' => array( __CLASS__, 'render' ), |
|
43 | ) |
|
44 | ); |
|
45 | } |
|
46 | } |
|
47 | ||
48 | /** |
|
49 | * Tiled gallery block registration |