-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path{block-slug}.php
More file actions
34 lines (29 loc) · 940 Bytes
/
Copy path{block-slug}.php
File metadata and controls
34 lines (29 loc) · 940 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
33
34
<?php
/**
* {block-name}
*
* @doc https://developer.wordpress.org/block-editor/reference-guides/interactivity-api/api-reference/
*
* @param array $block The block settings and attributes.
*
*/
defined('ABSPATH') or die();
$classes = array('{domain}-{block-slug}');
if ($is_preview) {
$classes[] = 'is-preview';
}
wp_interactivity_config('{domain}/{block-slug}', array(
'translations' => require(__DIR__ . '/languages/messages.php'),
'locale' => 'en',
));
?>
<figure v-cloak <?php echo get_block_wrapper_attributes(array('id' => "{domain}-{block-slug}", 'class' => esc_attr(implode(' ', $classes)))); ?>>
<?php if ($is_preview) : ?>
<div class="wp-block-group">
<p class="text-center">
<div><strong>This section's content is visible only on the front end.</strong></div>
<em>However, you can click here to view additional section options</em>
</p>
</div>
<?php endif; ?>
</figure>