@@ -2,7 +2,7 @@ |
||
2 | 2 | |
3 | 3 | use ACFComposer\ACFComposer; |
4 | 4 | |
5 | -add_action('Flynt/afterRegisterComponents', function () { |
|
5 | +add_action('Flynt/afterRegisterComponents', function() { |
|
6 | 6 | ACFComposer::registerFieldGroup([ |
7 | 7 | 'name' => 'postComponents', |
8 | 8 | 'title' => 'Post Components', |
@@ -2,7 +2,7 @@ |
||
2 | 2 | |
3 | 3 | use ACFComposer\ACFComposer; |
4 | 4 | |
5 | -add_action('Flynt/afterRegisterComponents', function () { |
|
5 | +add_action('Flynt/afterRegisterComponents', function() { |
|
6 | 6 | ACFComposer::registerFieldGroup([ |
7 | 7 | 'name' => 'pageComponents', |
8 | 8 | 'title' => 'Page Components', |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | return is_null($output) ? '' : $output; |
45 | 45 | } |
46 | 46 | |
47 | -add_filter('Flynt/renderComponent', function ($output, $componentName, $data) { |
|
47 | +add_filter('Flynt/renderComponent', function($output, $componentName, $data) { |
|
48 | 48 | return apply_filters( |
49 | 49 | "Flynt/renderComponent?name={$componentName}", |
50 | 50 | $output, |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | ); |
54 | 54 | }, 10, 3); |
55 | 55 | |
56 | -add_filter('Flynt/addComponentData', function ($data, $componentName) { |
|
56 | +add_filter('Flynt/addComponentData', function($data, $componentName) { |
|
57 | 57 | return apply_filters( |
58 | 58 | "Flynt/addComponentData?name={$componentName}", |
59 | 59 | $data, |
@@ -8,13 +8,13 @@ discard block |
||
8 | 8 | use Flynt; |
9 | 9 | use Timber\Image; |
10 | 10 | |
11 | -add_filter('Flynt/addComponentData?name=ListComponents', function ($data) { |
|
11 | +add_filter('Flynt/addComponentData?name=ListComponents', function($data) { |
|
12 | 12 | Component::enqueueAssets('ListComponents'); |
13 | 13 | |
14 | 14 | if (!empty($data['componentBlocks'])) { |
15 | - $data['componentBlocks'] = array_map(function ($block) { |
|
15 | + $data['componentBlocks'] = array_map(function($block) { |
|
16 | 16 | $componentPaths = explode('/', $block['component']); |
17 | - $block['component'] = implode('/', array_slice($componentPaths, count($componentPaths)-3, 3)); |
|
17 | + $block['component'] = implode('/', array_slice($componentPaths, count($componentPaths) - 3, 3)); |
|
18 | 18 | |
19 | 19 | if (file_exists(Asset::requirePath($block['component'] . 'preview-desktop.jpg'))) { |
20 | 20 | $src = Asset::requireUrl($block['component'] . 'preview-desktop.jpg'); |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | ]; |
27 | 27 | } |
28 | 28 | |
29 | - if (file_exists(Asset::requirePath($block['component']."preview-mobile.jpg"))) { |
|
29 | + if (file_exists(Asset::requirePath($block['component'] . "preview-mobile.jpg"))) { |
|
30 | 30 | $src = Asset::requireUrl($block['component'] . 'preview-mobile.jpg'); |
31 | 31 | list($width, $height) = getimagesize(Asset::requirePath($block['component'] . 'preview-mobile.jpg')); |
32 | 32 | |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | }); |
50 | 50 | |
51 | 51 | |
52 | -add_filter('acf/load_field/name=component', function ($field) { |
|
52 | +add_filter('acf/load_field/name=component', function($field) { |
|
53 | 53 | $componentManager = ComponentManager::getInstance(); |
54 | 54 | $field['choices'] = array_flip($componentManager->getAll()); |
55 | 55 | return $field; |
@@ -5,7 +5,7 @@ |
||
5 | 5 | use Flynt\Utils\Component; |
6 | 6 | use Flynt; |
7 | 7 | |
8 | -add_filter('Flynt/addComponentData?name=ListTestimonialCards', function ($data) { |
|
8 | +add_filter('Flynt/addComponentData?name=ListTestimonialCards', function($data) { |
|
9 | 9 | Component::enqueueAssets('ListTestimonialCards'); |
10 | 10 | |
11 | 11 | return $data; |
@@ -5,13 +5,13 @@ |
||
5 | 5 | use Flynt\Utils\Component; |
6 | 6 | use Timber\Menu; |
7 | 7 | |
8 | -add_action('init', function () { |
|
8 | +add_action('init', function() { |
|
9 | 9 | register_nav_menus([ |
10 | 10 | 'navigation_footer' => __('Navigation Footer', 'flynt-starter-theme') |
11 | 11 | ]); |
12 | 12 | }); |
13 | 13 | |
14 | -add_filter('Flynt/addComponentData?name=NavigationFooter', function ($data) { |
|
14 | +add_filter('Flynt/addComponentData?name=NavigationFooter', function($data) { |
|
15 | 15 | Component::enqueueAssets('NavigationFooter'); |
16 | 16 | |
17 | 17 | $data['maxLevel'] = 0; |
@@ -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' />" : ''; |
@@ -80,8 +80,8 @@ discard block |
||
80 | 80 | return crypt(serialize($args), NONCE_SALT); |
81 | 81 | } |
82 | 82 | |
83 | -add_action('timber/twig/filters', function ($twig) { |
|
84 | - $twig->addFilter(new \Twig_SimpleFilter('resizeDynamic', function ($src, $w, $h = 0, $crop = 'default', $force = false) { |
|
83 | +add_action('timber/twig/filters', function($twig) { |
|
84 | + $twig->addFilter(new \Twig_SimpleFilter('resizeDynamic', function($src, $w, $h = 0, $crop = 'default', $force = false) { |
|
85 | 85 | $arguments = [ |
86 | 86 | 'src' => $src, |
87 | 87 | 'w' => $w, |
@@ -5,7 +5,7 @@ |
||
5 | 5 | use Flynt\Utils\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', |
@@ -5,7 +5,7 @@ |
||
5 | 5 | use Flynt\Utils\Component; |
6 | 6 | use Flynt; |
7 | 7 | |
8 | -add_filter('Flynt/addComponentData?name=GridPostsSlider', function ($data) { |
|
8 | +add_filter('Flynt/addComponentData?name=GridPostsSlider', function($data) { |
|
9 | 9 | Component::enqueueAssets('GridPostsSlider', [ |
10 | 10 | [ |
11 | 11 | 'name' => 'slick-carousel', |