@@ -6,7 +6,7 @@ |
||
6 | 6 | use Flynt\Utils\Options; |
7 | 7 | use Timber\Timber; |
8 | 8 | |
9 | -add_filter('Flynt/addComponentData?name=ListSearchResults', function ($data) { |
|
9 | +add_filter('Flynt/addComponentData?name=ListSearchResults', function($data) { |
|
10 | 10 | $data['prevIcon'] = Asset::getContents('Components/ListSearchResults/Assets/navigation-prev.svg'); |
11 | 11 | $data['nextIcon'] = Asset::getContents('Components/ListSearchResults/Assets/navigation-next.svg'); |
12 | 12 | $data['searchIcon'] = Asset::getContents('Components/ListSearchResults/Assets/search.svg'); |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | |
23 | 23 | // Convert ACF Field of type relationship to a Timber\Post and add all ACF Fields of that Post |
24 | 24 | add_filter('acf/format_value/type=relationship', NS . 'formatPostObject', 100); |
25 | -add_filter('get_twig', function ($twig) { |
|
25 | +add_filter('get_twig', function($twig) { |
|
26 | 26 | $twig->addExtension(new TwigExtensionFlynt()); |
27 | 27 | return $twig; |
28 | 28 | }); |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | function formatGallery($value) |
39 | 39 | { |
40 | 40 | if (!empty($value)) { |
41 | - $value = array_map(function ($image) { |
|
41 | + $value = array_map(function($image) { |
|
42 | 42 | return new Image($image); |
43 | 43 | }, $value); |
44 | 44 | } |
@@ -63,8 +63,8 @@ discard block |
||
63 | 63 | return $value; |
64 | 64 | } |
65 | 65 | |
66 | -add_action('timber/twig/filters', function ($twig) { |
|
67 | - $twig->addFunction(new \Twig_SimpleFunction('placeholderImage', function ($width, $height, $color = null) { |
|
66 | +add_action('timber/twig/filters', function($twig) { |
|
67 | + $twig->addFunction(new \Twig_SimpleFunction('placeholderImage', function($width, $height, $color = null) { |
|
68 | 68 | $width = round($width); |
69 | 69 | $height = round($height); |
70 | 70 | $colorRect = $color ? "<rect width='{$width}' height='{$height}' style='fill:$color' />" : ''; |
@@ -48,13 +48,13 @@ |
||
48 | 48 | return ''; |
49 | 49 | } |
50 | 50 | |
51 | - $area = function ($areaName) use ($areaHtml) { |
|
51 | + $area = function($areaName) use ($areaHtml) { |
|
52 | 52 | if (array_key_exists($areaName, $areaHtml)) { |
53 | 53 | return $areaHtml[$areaName]; |
54 | 54 | } |
55 | 55 | }; |
56 | 56 | |
57 | - $data = function () use ($componentData) { |
|
57 | + $data = function() use ($componentData) { |
|
58 | 58 | $args = func_get_args(); |
59 | 59 | array_unshift($args, $componentData); |
60 | 60 | return Helpers::extractNestedDataFromArray($args); |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | |
79 | 79 | function registerHooks() |
80 | 80 | { |
81 | - add_filter('Flynt/renderComponent', function ($output, $componentName, $data) { |
|
81 | + add_filter('Flynt/renderComponent', function($output, $componentName, $data) { |
|
82 | 82 | return apply_filters( |
83 | 83 | "Flynt/renderComponent?name={$componentName}", |
84 | 84 | $output, |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | ); |
88 | 88 | }, 10, 3); |
89 | 89 | |
90 | - add_filter('Flynt/addComponentData', function ($data, $componentName) { |
|
90 | + add_filter('Flynt/addComponentData', function($data, $componentName) { |
|
91 | 91 | return apply_filters( |
92 | 92 | "Flynt/addComponentData?name={$componentName}", |
93 | 93 | $data, |
@@ -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"); |
@@ -4,7 +4,7 @@ |
||
4 | 4 | |
5 | 5 | use Flynt\Utils\Asset; |
6 | 6 | |
7 | -add_action('wp_enqueue_scripts', function () { |
|
7 | +add_action('wp_enqueue_scripts', function() { |
|
8 | 8 | $jqueryVersion = wp_scripts()->registered['jquery']->ver; |
9 | 9 | wp_deregister_script('jquery'); |
10 | 10 |
@@ -2,7 +2,7 @@ discard block |
||
2 | 2 | |
3 | 3 | use Flynt\Utils\Asset; |
4 | 4 | |
5 | -add_action('wp_enqueue_scripts', function () { |
|
5 | +add_action('wp_enqueue_scripts', function() { |
|
6 | 6 | Asset::enqueue([ |
7 | 7 | 'name' => 'Flynt/assets/vendor', |
8 | 8 | 'type' => 'script', |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | ]); |
32 | 32 | }); |
33 | 33 | |
34 | -add_action('admin_enqueue_scripts', function () { |
|
34 | +add_action('admin_enqueue_scripts', function() { |
|
35 | 35 | Asset::enqueue([ |
36 | 36 | 'name' => 'Flynt/assets/vendorAdmin', |
37 | 37 | 'type' => 'script', |