@@ -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; |
@@ -5,7 +5,7 @@ |
||
5 | 5 | use Flynt\Features\Components\Component; |
6 | 6 | use Flynt; |
7 | 7 | |
8 | -add_filter('Flynt/addComponentData?name=ListFacts', function ($data) { |
|
8 | +add_filter('Flynt/addComponentData?name=ListFacts', function($data) { |
|
9 | 9 | Component::enqueueAssets('ListFacts', [ |
10 | 10 | [ |
11 | 11 | 'name' => 'countup', |
@@ -6,7 +6,7 @@ |
||
6 | 6 | use Flynt\Utils\Component; |
7 | 7 | use Flynt\Utils\Options; |
8 | 8 | |
9 | -add_filter('Flynt/addComponentData?name=ListSearchResults', function ($data) { |
|
9 | +add_filter('Flynt/addComponentData?name=ListSearchResults', function($data) { |
|
10 | 10 | Component::enqueueAssets('ListSearchResults'); |
11 | 11 | |
12 | 12 | global $wp_query; |
@@ -5,7 +5,7 @@ |
||
5 | 5 | use Flynt\Utils\Component; |
6 | 6 | use Flynt; |
7 | 7 | |
8 | -add_filter('Flynt/addComponentData?name=BlockImageText', function ($data) { |
|
8 | +add_filter('Flynt/addComponentData?name=BlockImageText', function($data) { |
|
9 | 9 | Component::enqueueAssets('BlockImageText'); |
10 | 10 | |
11 | 11 | return $data; |
@@ -6,7 +6,7 @@ |
||
6 | 6 | use Flynt\Utils\Oembed; |
7 | 7 | use Flynt; |
8 | 8 | |
9 | -add_filter('Flynt/addComponentData?name=BlockVideoOembed', function ($data) { |
|
9 | +add_filter('Flynt/addComponentData?name=BlockVideoOembed', function($data) { |
|
10 | 10 | Component::enqueueAssets('BlockVideoOembed'); |
11 | 11 | |
12 | 12 | $data['video'] = Oembed::setSrcAsDataAttribute( |
@@ -6,11 +6,11 @@ |
||
6 | 6 | use Flynt\Utils\Component; |
7 | 7 | use Flynt; |
8 | 8 | |
9 | -add_filter('Flynt/addComponentData?name=ListSocial', function ($data) { |
|
9 | +add_filter('Flynt/addComponentData?name=ListSocial', function($data) { |
|
10 | 10 | Component::enqueueAssets('ListSocial'); |
11 | 11 | |
12 | 12 | if (!empty($data['social'])) { |
13 | - $data['social'] = array_map(function ($item) { |
|
13 | + $data['social'] = array_map(function($item) { |
|
14 | 14 | $item['icon'] = Asset::getContents("Components/ListSocial/Assets/{$item['platform']}.svg"); |
15 | 15 | return $item; |
16 | 16 | }, $data['social']); |
@@ -5,7 +5,7 @@ |
||
5 | 5 | use Flynt\Utils\Component; |
6 | 6 | use Flynt; |
7 | 7 | |
8 | -add_filter('Flynt/addComponentData?name=HeroImageText', function ($data) { |
|
8 | +add_filter('Flynt/addComponentData?name=HeroImageText', function($data) { |
|
9 | 9 | Component::enqueueAssets('HeroImageText'); |
10 | 10 | |
11 | 11 | return $data; |
@@ -6,7 +6,7 @@ |
||
6 | 6 | use Timber\Post; |
7 | 7 | use Flynt; |
8 | 8 | |
9 | -add_filter('Flynt/addComponentData?name=ListPostCards', function ($data) { |
|
9 | +add_filter('Flynt/addComponentData?name=ListPostCards', function($data) { |
|
10 | 10 | Component::enqueueAssets('ListPostCards'); |
11 | 11 | |
12 | 12 | $posts = Timber::get_posts([ |
@@ -5,7 +5,7 @@ |
||
5 | 5 | use Flynt\Utils\Component; |
6 | 6 | use Flynt; |
7 | 7 | |
8 | -add_filter('Flynt/addComponentData?name=BlockNotFound', function ($data) { |
|
8 | +add_filter('Flynt/addComponentData?name=BlockNotFound', function($data) { |
|
9 | 9 | Component::enqueueAssets('BlockNotFound'); |
10 | 10 | |
11 | 11 | return $data; |