← All changes
|
extensions/blocks/send-a-message/send-a-message.php
+2
-5
12.5.2
→
16.3-a.1
View file →
| @@ -11,11 +11,8 @@ | ||
| 11 | 11 | |
| 12 | 12 | use Automattic\Jetpack\Blocks; |
| 13 | 13 | use Jetpack_Gutenberg; |
| 14 | 14 | |
| 15 | -const FEATURE_NAME = 'send-a-message'; | |
| 16 | -const BLOCK_NAME = 'jetpack/' . FEATURE_NAME; | |
| 17 | - | |
| 18 | 15 | /** |
| 19 | 16 | * Registers the block for use in Gutenberg |
| 20 | 17 | * This is done via an action so that we can disable |
| 21 | 18 | * registration if we need to. |
| @@ -21,9 +18,9 @@ | ||
| 21 | 18 | * registration if we need to. |
| 22 | 19 | */ |
| 23 | 20 | function register_block() { |
| 24 | 21 | Blocks::jetpack_register_block( |
| 25 | - BLOCK_NAME, | |
| 22 | + __DIR__, | |
| 26 | 23 | array( |
| 27 | 24 | 'render_callback' => __NAMESPACE__ . '\render_block', |
| 28 | 25 | 'plan_check' => true, |
| 29 | 26 | ) |
| @@ -39,8 +36,8 @@ | ||
| 39 | 36 | * |
| 40 | 37 | * @return string |
| 41 | 38 | */ |
| 42 | 39 | function render_block( $attributes, $content ) { |
| 43 | - Jetpack_Gutenberg::load_styles_as_required( FEATURE_NAME ); | |
| 40 | + Jetpack_Gutenberg::load_styles_as_required( Blocks::get_block_feature( __DIR__ ) ); | |
| 44 | 41 | |
| 45 | 42 | return $content; |
| 46 | 43 | } |