← All changes
|
extensions/blocks/premium-content/subscriber-view/subscriber-view.php
+7
-15
12.3.2
→
16.3-beta
View file →
| @@ -7,9 +7,8 @@ | ||
| 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 | |
| 14 | 13 | const SUBSCRIBER_VIEW_NAME = 'premium-content/subscriber-view'; |
| 15 | 14 | |
| @@ -20,22 +19,15 @@ | ||
| 20 | 19 | * This is done via an action so that we can disable |
| 21 | 20 | * registration if we need to. |
| 22 | 21 | */ |
| 23 | 22 | function register_subscriber_view_block() { |
| 24 | - // Only load this block on WordPress.com. | |
| 25 | - if ( ( defined( 'IS_WPCOM' ) && IS_WPCOM ) || ( new Host() )->is_woa_site() ) { | |
| 26 | - // Determine required `context` key based on Gutenberg version. | |
| 27 | - $deprecated = function_exists( 'gutenberg_get_post_from_context' ); | |
| 28 | - $uses = $deprecated ? 'context' : 'uses_context'; | |
| 29 | - | |
| 30 | - Blocks::jetpack_register_block( | |
| 31 | - SUBSCRIBER_VIEW_NAME, | |
| 32 | - array( | |
| 33 | - 'render_callback' => __NAMESPACE__ . '\render_subscriber_view_block', | |
| 34 | - $uses => array( 'premium-content/planId' ), | |
| 35 | - ) | |
| 36 | - ); | |
| 37 | - } | |
| 23 | + Blocks::jetpack_register_block( | |
| 24 | + SUBSCRIBER_VIEW_NAME, | |
| 25 | + array( | |
| 26 | + 'render_callback' => __NAMESPACE__ . '\render_subscriber_view_block', | |
| 27 | + 'uses_context' => array( 'premium-content/planId', 'premium-content/planIds' ), | |
| 28 | + ) | |
| 29 | + ); | |
| 38 | 30 | } |
| 39 | 31 | add_action( 'init', __NAMESPACE__ . '\register_subscriber_view_block' ); |
| 40 | 32 | |
| 41 | 33 | /** |