@@ -6,11 +6,11 @@ discard block |
||
6 | 6 | use Flynt\ComponentManager; |
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 | if (!empty($data['componentBlocks'])) { |
11 | - $data['componentBlocks'] = array_map(function ($block) { |
|
11 | + $data['componentBlocks'] = array_map(function($block) { |
|
12 | 12 | $componentPaths = explode('/', $block['component']); |
13 | - $block['component'] = implode('/', array_slice($componentPaths, count($componentPaths)-3, 3)); |
|
13 | + $block['component'] = implode('/', array_slice($componentPaths, count($componentPaths) - 3, 3)); |
|
14 | 14 | |
15 | 15 | if (file_exists(Asset::requirePath($block['component'] . 'screenshot.png'))) { |
16 | 16 | $src = Asset::requireUrl($block['component'] . 'screenshot.png'); |
@@ -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 @@ discard block |
||
5 | 5 | |
6 | 6 | define(__NAMESPACE__ . '\NS', __NAMESPACE__ . '\\'); |
7 | 7 | |
8 | -add_action('admin_enqueue_scripts', function () { |
|
8 | +add_action('admin_enqueue_scripts', function() { |
|
9 | 9 | $data = [ |
10 | 10 | 'templateDirectoryUri' => get_template_directory_uri() . '/dist', |
11 | 11 | ]; |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | if (class_exists('acf')) { |
16 | 16 | if (is_admin()) { |
17 | 17 | // add image to the flexible content component name |
18 | - add_filter('acf/fields/flexible_content/layout_title', function ($title, $field, $layout, $i) { |
|
18 | + add_filter('acf/fields/flexible_content/layout_title', function($title, $field, $layout, $i) { |
|
19 | 19 | $componentName = ucfirst($layout['name']); |
20 | 20 | $componentPath = "Components/{$componentName}"; |
21 | 21 | $componentScreenshotPath = Asset::requirePath("{$componentPath}/screenshot.png"); |