← All changes
|
extensions/blocks/contact-form/contact-form.php
+25
-0
16.2-beta
→
16.3-a.7
View file →
| @@ -1,0 +1,25 @@ | ||
| 1 | +<?php | |
| 2 | +/** | |
| 3 | + * Contact Form Block. | |
| 4 | + * | |
| 5 | + * @package automattic/jetpack | |
| 6 | + */ | |
| 7 | + | |
| 8 | +namespace Automattic\Jetpack\Extensions\Contact_Form; | |
| 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 | + */ | |
| 25 | +add_action( 'init', array( Contact_Form_Block::class, 'register_block' ), 9 ); | |