Skip to content

Commit

Permalink
added support for anchor
Browse files Browse the repository at this point in the history
  • Loading branch information
tombroucke committed Feb 26, 2020
1 parent 684f4d5 commit 12be0ef
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions sage-acf-gutenberg-blocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
'align' => 'Align',
'post_types' => 'PostTypes',
'supports_align' => 'SupportsAlign',
'supports_anchor' => 'SupportsAnchor',
'supports_mode' => 'SupportsMode',
'supports_multiple' => 'SupportsMultiple',
'enqueue_style' => 'EnqueueStyle',
Expand Down Expand Up @@ -116,6 +117,11 @@
$data['supports']['align'] = in_array($file_headers['supports_align'], array('true', 'false'), true) ? filter_var($file_headers['supports_align'], FILTER_VALIDATE_BOOLEAN) : explode(' ', $file_headers['supports_align']);
}

// If the SupportsMode header is set in the template, restrict this block mode feature
if (!empty($file_headers['supports_anchor'])) {
$data['supports']['anchor'] = $file_headers['supports_anchor'] === 'true' ? true : false;
}

// If the SupportsMode header is set in the template, restrict this block mode feature
if (!empty($file_headers['supports_mode'])) {
$data['supports']['mode'] = $file_headers['supports_mode'] === 'true' ? true : false;
Expand Down

0 comments on commit 12be0ef

Please # to comment.