contact-form.php
24 lines
| 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 | // Register the block |
| 15 | add_action( 'init', array( Contact_Form_Block::class, 'register_block' ), 9 ); |
| 16 | |
| 17 | // Load scripts for the editing interface |
| 18 | add_action( 'enqueue_block_editor_assets', array( Contact_Form_Block::class, 'load_editor_scripts' ), 9 ); |
| 19 | |
| 20 | // Load styles in the editor iframe context |
| 21 | if ( is_admin() ) { |
| 22 | add_action( 'enqueue_block_assets', array( Contact_Form_Block::class, 'load_editor_styles' ), 9 ); |
| 23 | } |
| 24 |