← All changes
|
extensions/blocks/premium-content/buttons/buttons.php
+10
-10
12.3.2
→
16.3-a.7
View file →
| @@ -7,11 +7,14 @@ | ||
| 7 | 7 | |
| 8 | 8 | namespace Automattic\Jetpack\Extensions\Premium_Content; |
| 9 | 9 | |
| 10 | 10 | use Automattic\Jetpack\Blocks; |
| 11 | -use Automattic\Jetpack\Status\Host; | |
| 12 | 11 | use Jetpack_Gutenberg; |
| 13 | 12 | |
| 13 | +if ( ! defined( 'ABSPATH' ) ) { | |
| 14 | + exit( 0 ); | |
| 15 | +} | |
| 16 | + | |
| 14 | 17 | const BUTTONS_NAME = 'premium-content/buttons'; |
| 15 | 18 | |
| 16 | 19 | /** |
| 17 | 20 | * Registers the block for use in Gutenberg |
| @@ -18,17 +21,14 @@ | ||
| 18 | 21 | * This is done via an action so that we can disable |
| 19 | 22 | * registration if we need to. |
| 20 | 23 | */ |
| 21 | 24 | function register_buttons_block() { |
| 22 | - // Only load this block on WordPress.com. | |
| 23 | - if ( ( defined( 'IS_WPCOM' ) && IS_WPCOM ) || ( new Host() )->is_woa_site() ) { | |
| 24 | - Blocks::jetpack_register_block( | |
| 25 | - BUTTONS_NAME, | |
| 26 | - array( | |
| 27 | - 'render_callback' => __NAMESPACE__ . '\render_buttons_block', | |
| 28 | - ) | |
| 29 | - ); | |
| 30 | - } | |
| 25 | + Blocks::jetpack_register_block( | |
| 26 | + BUTTONS_NAME, | |
| 27 | + array( | |
| 28 | + 'render_callback' => __NAMESPACE__ . '\render_buttons_block', | |
| 29 | + ) | |
| 30 | + ); | |
| 31 | 31 | } |
| 32 | 32 | add_action( 'init', __NAMESPACE__ . '\register_buttons_block' ); |
| 33 | 33 | |
| 34 | 34 | /** |