@@ -5,11 +5,11 @@ |
||
| 5 | 5 | use Flynt\Utils\Component; |
| 6 | 6 | use Flynt; |
| 7 | 7 | |
| 8 | -add_filter('Flynt/addComponentData?name=GridDownloadPortrait', function ($data) { |
|
| 8 | +add_filter('Flynt/addComponentData?name=GridDownloadPortrait', function($data) { |
|
| 9 | 9 | Component::enqueueAssets('GridDownloadPortrait'); |
| 10 | 10 | |
| 11 | 11 | if (!empty($data['items'])) { |
| 12 | - $data['items'] = array_map(function ($item) { |
|
| 12 | + $data['items'] = array_map(function($item) { |
|
| 13 | 13 | if ($item['itemType'] === 'itemFile') { |
| 14 | 14 | $fileSize = filesize(get_attached_file($item['file']['id'])); |
| 15 | 15 | $item['file']['fileSize'] = size_format($fileSize); |
@@ -5,7 +5,7 @@ |
||
| 5 | 5 | use Flynt\Utils\Component; |
| 6 | 6 | use Flynt; |
| 7 | 7 | |
| 8 | -add_filter('Flynt/addComponentData?name=GridContentLists', function ($data) { |
|
| 8 | +add_filter('Flynt/addComponentData?name=GridContentLists', function($data) { |
|
| 9 | 9 | Component::enqueueAssets('GridContentLists'); |
| 10 | 10 | |
| 11 | 11 | return $data; |
@@ -5,7 +5,7 @@ |
||
| 5 | 5 | use Flynt\Utils\Component; |
| 6 | 6 | use Flynt; |
| 7 | 7 | |
| 8 | -add_filter('Flynt/addComponentData?name=HeroCta', function ($data) { |
|
| 8 | +add_filter('Flynt/addComponentData?name=HeroCta', function($data) { |
|
| 9 | 9 | Component::enqueueAssets('HeroCta'); |
| 10 | 10 | |
| 11 | 11 | return $data; |
@@ -5,7 +5,7 @@ |
||
| 5 | 5 | use Flynt\Utils\Component; |
| 6 | 6 | use Flynt; |
| 7 | 7 | |
| 8 | -add_filter('Flynt/addComponentData?name=GridPosts', function ($data) { |
|
| 8 | +add_filter('Flynt/addComponentData?name=GridPosts', function($data) { |
|
| 9 | 9 | Component::enqueueAssets('GridPosts'); |
| 10 | 10 | |
| 11 | 11 | return $data; |
@@ -5,7 +5,7 @@ |
||
| 5 | 5 | use Flynt\Utils\Component; |
| 6 | 6 | use Flynt; |
| 7 | 7 | |
| 8 | -add_filter('Flynt/addComponentData?name=BlockWysiwyg', function ($data) { |
|
| 8 | +add_filter('Flynt/addComponentData?name=BlockWysiwyg', function($data) { |
|
| 9 | 9 | Component::enqueueAssets('BlockWysiwyg'); |
| 10 | 10 | |
| 11 | 11 | return $data; |
@@ -6,7 +6,7 @@ |
||
| 6 | 6 | use Flynt\Utils\Options; |
| 7 | 7 | use Flynt; |
| 8 | 8 | |
| 9 | -add_filter('Flynt/addComponentData?name=ListPosts', function ($data) { |
|
| 9 | +add_filter('Flynt/addComponentData?name=ListPosts', function($data) { |
|
| 10 | 10 | Component::enqueueAssets('ListPosts'); |
| 11 | 11 | $data['isArchive'] = is_home() || is_archive(); |
| 12 | 12 | |
@@ -5,7 +5,7 @@ |
||
| 5 | 5 | use Flynt\Utils\Component; |
| 6 | 6 | use Flynt; |
| 7 | 7 | |
| 8 | -add_filter('Flynt/addComponentData?name=HeroImage', function ($data) { |
|
| 8 | +add_filter('Flynt/addComponentData?name=HeroImage', function($data) { |
|
| 9 | 9 | Component::enqueueAssets('HeroImage', [ |
| 10 | 10 | [ |
| 11 | 11 | 'name' => 'lazysizes', |
@@ -5,7 +5,7 @@ |
||
| 5 | 5 | use Flynt\Utils\Component; |
| 6 | 6 | use Flynt; |
| 7 | 7 | |
| 8 | -add_filter('Flynt/addComponentData?name=AccordionDefault', function ($data) { |
|
| 8 | +add_filter('Flynt/addComponentData?name=AccordionDefault', function($data) { |
|
| 9 | 9 | Component::enqueueAssets('AccordionDefault'); |
| 10 | 10 | return $data; |
| 11 | 11 | }); |
@@ -7,22 +7,22 @@ discard block |
||
| 7 | 7 | use Flynt\Utils\Asset; |
| 8 | 8 | use Flynt; |
| 9 | 9 | |
| 10 | -add_filter('Flynt/addComponentData?name=ListComponents', function ($data) { |
|
| 10 | +add_filter('Flynt/addComponentData?name=ListComponents', function($data) { |
|
| 11 | 11 | Component::enqueueAssets('ListComponents'); |
| 12 | 12 | |
| 13 | 13 | if (!empty($data['componentBlocks'])) { |
| 14 | - $data['componentBlocks'] = array_map(function ($block) { |
|
| 14 | + $data['componentBlocks'] = array_map(function($block) { |
|
| 15 | 15 | $componentPaths = explode('/', $block['component']); |
| 16 | - $block['component'] = implode('/', array_slice($componentPaths, count($componentPaths)-3, 3)); |
|
| 16 | + $block['component'] = implode('/', array_slice($componentPaths, count($componentPaths) - 3, 3)); |
|
| 17 | 17 | |
| 18 | - if (file_exists(Asset::requirePath($block['component']."preview-desktop.jpg"))) { |
|
| 19 | - $block['componentPreviewDesktopUrl'] = Asset::requireUrl($block['component']."preview-desktop.jpg"); |
|
| 18 | + if (file_exists(Asset::requirePath($block['component'] . "preview-desktop.jpg"))) { |
|
| 19 | + $block['componentPreviewDesktopUrl'] = Asset::requireUrl($block['component'] . "preview-desktop.jpg"); |
|
| 20 | 20 | } |
| 21 | 21 | |
| 22 | - if (file_exists(Asset::requirePath($block['component']."preview-mobile.jpg"))) { |
|
| 23 | - $block['componentPreviewMobileUrl'] = Asset::requireUrl($block['component']."preview-mobile.jpg"); |
|
| 22 | + if (file_exists(Asset::requirePath($block['component'] . "preview-mobile.jpg"))) { |
|
| 23 | + $block['componentPreviewMobileUrl'] = Asset::requireUrl($block['component'] . "preview-mobile.jpg"); |
|
| 24 | 24 | } |
| 25 | - $readme = Asset::requirePath($block['component']."README.md"); |
|
| 25 | + $readme = Asset::requirePath($block['component'] . "README.md"); |
|
| 26 | 26 | |
| 27 | 27 | if (file_exists($readme)) { |
| 28 | 28 | $block['readme'] = parsePreviewContent(file_get_contents($readme)); |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | }); |
| 37 | 37 | |
| 38 | 38 | |
| 39 | -add_filter('acf/load_field/name=component', function ($field) { |
|
| 39 | +add_filter('acf/load_field/name=component', function($field) { |
|
| 40 | 40 | $componentManager = ComponentManager::getInstance(); |
| 41 | 41 | $field['choices'] = array_flip($componentManager->getAll()); |
| 42 | 42 | return $field; |