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