-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathwrapper-block-example.php
More file actions
32 lines (29 loc) · 942 Bytes
/
wrapper-block-example.php
File metadata and controls
32 lines (29 loc) · 942 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php
/**
* Plugin Name: Wrapper Block Example
* Description: Example how to create a wrapper block for Gutenberg in WordPress.
* Author: Liip AG
* Author URI: https://liip.ch
* Version: 1.0.0
* License: GPL2+
* License URI: https://www.gnu.org/licenses/gpl-2.0.txt
* Text Domain: wrapper-block-example
* Domain Path: /languages/
*
* @package wrapper-block-example
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
add_action( 'enqueue_block_editor_assets', 'wrapper_block_example_enqueue_block_editor_assets' );
function wrapper_block_example_enqueue_block_editor_assets() {
// Enqueue our script
wp_enqueue_script(
'wrapper-block-example-js',
esc_url( plugins_url( '/dist/wrapper-block-example.js', __FILE__ ) ),
array( 'wp-blocks', 'wp-i18n', 'wp-element', 'wp-editor', 'wp-components' ),
'1.0.0',
true // Enqueue the script in the footer.
);
}