← All changes
|
extensions/blocks/contact-form/contact-form.php
+15
-2
13.3.3
→
16.3-a.7
View file →
| @@ -6,7 +6,20 @@ | ||
| 6 | 6 | */ |
| 7 | 7 | |
| 8 | 8 | namespace Automattic\Jetpack\Extensions\Contact_Form; |
| 9 | 9 | |
| 10 | +if ( ! defined( 'ABSPATH' ) ) { | |
| 11 | + exit( 0 ); | |
| 12 | +} | |
| 13 | + | |
| 14 | +/* | |
| 15 | + * Register the block as a fallback when loaded via the Blocks module. | |
| 16 | + * | |
| 17 | + * The Forms package registers this block when the Forms (contact-form) module is active. | |
| 18 | + * When only the Blocks module is active, this ensures the block is still registered so | |
| 19 | + * admins see a nudge to activate the Forms module. | |
| 20 | + * | |
| 21 | + * Contact_Form_Block::register_block() calls can_manage_block() internally, | |
| 22 | + * and Blocks::jetpack_register_block() is a no-op if the block is already registered, | |
| 23 | + * so double-registration is not possible. | |
| 24 | + */ | |
| 10 | 25 | add_action( 'init', array( Contact_Form_Block::class, 'register_block' ), 9 ); |
| 11 | - | |
| 12 | -add_action( 'enqueue_block_editor_assets', array( Contact_Form_Block::class, 'load_editor_scripts' ), 9 ); | |