@@ -4,8 +4,8 @@ |
||
4 | 4 | |
5 | 5 | use Flynt\Features\Components\Component; |
6 | 6 | |
7 | -add_filter('Flynt/addComponentData?name=HeroImage', function ($data) { |
|
8 | - add_action('wp_enqueue_scripts', function () { |
|
7 | +add_filter('Flynt/addComponentData?name=HeroImage', function($data) { |
|
8 | + add_action('wp_enqueue_scripts', function() { |
|
9 | 9 | Component::enqueueAssets('HeroImage', [ |
10 | 10 | [ |
11 | 11 | 'name' => 'lazysizes', |
@@ -4,8 +4,8 @@ |
||
4 | 4 | |
5 | 5 | use Flynt\Features\Components\Component; |
6 | 6 | |
7 | -add_filter('Flynt/addComponentData?name=GridPosts', function ($data, $parentData) { |
|
8 | - add_action('wp_enqueue_scripts', function () { |
|
7 | +add_filter('Flynt/addComponentData?name=GridPosts', function($data, $parentData) { |
|
8 | + add_action('wp_enqueue_scripts', function() { |
|
9 | 9 | Component::enqueueAssets('GridPosts'); |
10 | 10 | }); |
11 | 11 |
@@ -5,13 +5,13 @@ |
||
5 | 5 | use Flynt\Utils\Asset; |
6 | 6 | use Flynt\Features\Components\Component; |
7 | 7 | |
8 | -add_filter('Flynt/addComponentData?name=ListSocial', function ($data) { |
|
9 | - add_action('wp_enqueue_scripts', function () { |
|
8 | +add_filter('Flynt/addComponentData?name=ListSocial', function($data) { |
|
9 | + add_action('wp_enqueue_scripts', function() { |
|
10 | 10 | Component::enqueueAssets('ListSocial'); |
11 | 11 | }); |
12 | 12 | |
13 | 13 | if (!empty($data['social'])) { |
14 | - $data['social'] = array_map(function ($item) { |
|
14 | + $data['social'] = array_map(function($item) { |
|
15 | 15 | $item['icon'] = Asset::getContents("Components/ListSocial/Assets/{$item['platform']}.svg"); |
16 | 16 | return $item; |
17 | 17 | }, $data['social']); |
@@ -5,8 +5,8 @@ |
||
5 | 5 | use Flynt\Utils\Asset; |
6 | 6 | use Flynt\Features\Components\Component; |
7 | 7 | |
8 | -add_filter('Flynt/addComponentData?name=ListSearchResults', function ($data, $parentData) { |
|
9 | - add_action('wp_enqueue_scripts', function () { |
|
8 | +add_filter('Flynt/addComponentData?name=ListSearchResults', function($data, $parentData) { |
|
9 | + add_action('wp_enqueue_scripts', function() { |
|
10 | 10 | Component::enqueueAssets('ListSearchResults'); |
11 | 11 | }); |
12 | 12 |
@@ -4,8 +4,8 @@ |
||
4 | 4 | |
5 | 5 | use Flynt\Features\Components\Component; |
6 | 6 | |
7 | -add_filter('Flynt/addComponentData?name=ListTestimonialCards', function ($data) { |
|
8 | - add_action('wp_enqueue_scripts', function () { |
|
7 | +add_filter('Flynt/addComponentData?name=ListTestimonialCards', function($data) { |
|
8 | + add_action('wp_enqueue_scripts', function() { |
|
9 | 9 | Component::enqueueAssets('ListTestimonialCards'); |
10 | 10 | }); |
11 | 11 |
@@ -4,8 +4,8 @@ |
||
4 | 4 | |
5 | 5 | use Flynt\Features\Components\Component; |
6 | 6 | |
7 | -add_filter('Flynt/addComponentData?name=ListFacts', function ($data) { |
|
8 | - add_action('wp_enqueue_scripts', function () { |
|
7 | +add_filter('Flynt/addComponentData?name=ListFacts', function($data) { |
|
8 | + add_action('wp_enqueue_scripts', function() { |
|
9 | 9 | Component::enqueueAssets('ListFacts', [ |
10 | 10 | [ |
11 | 11 | 'name' => 'countup', |
@@ -6,17 +6,17 @@ |
||
6 | 6 | use Timber\Menu; |
7 | 7 | use Flynt\Utils\Asset; |
8 | 8 | |
9 | -add_action('wp_enqueue_scripts', function () { |
|
9 | +add_action('wp_enqueue_scripts', function() { |
|
10 | 10 | Component::enqueueAssets('NavigationMain'); |
11 | 11 | }); |
12 | 12 | |
13 | -add_action('init', function () { |
|
13 | +add_action('init', function() { |
|
14 | 14 | register_nav_menus([ |
15 | 15 | 'navigation_main' => __('Navigation Main', 'flynt-starter-theme') |
16 | 16 | ]); |
17 | 17 | }); |
18 | 18 | |
19 | -add_filter('Flynt/addComponentData?name=NavigationMain', function ($data) { |
|
19 | +add_filter('Flynt/addComponentData?name=NavigationMain', function($data) { |
|
20 | 20 | $data['maxLevel'] = 0; |
21 | 21 | $data['menu'] = new Menu('navigation_main'); |
22 | 22 |
@@ -4,8 +4,8 @@ |
||
4 | 4 | |
5 | 5 | use Flynt\Features\Components\Component; |
6 | 6 | |
7 | -add_filter('Flynt/addComponentData?name=GridPostsSlider', function ($data) { |
|
8 | - add_action('wp_enqueue_scripts', function () { |
|
7 | +add_filter('Flynt/addComponentData?name=GridPostsSlider', function($data) { |
|
8 | + add_action('wp_enqueue_scripts', function() { |
|
9 | 9 | Component::enqueueAssets('GridPostsSlider', [ |
10 | 10 | [ |
11 | 11 | 'name' => 'slick-carousel', |
@@ -39,9 +39,9 @@ discard block |
||
39 | 39 | return $output; |
40 | 40 | } |
41 | 41 | |
42 | - $addArea = function ($twig) use ($areaHtml) { |
|
42 | + $addArea = function($twig) use ($areaHtml) { |
|
43 | 43 | |
44 | - $twig->addFunction(new Twig_SimpleFunction('area', function ($areaName) use ($areaHtml) { |
|
44 | + $twig->addFunction(new Twig_SimpleFunction('area', function($areaName) use ($areaHtml) { |
|
45 | 45 | if (array_key_exists($areaName, $areaHtml)) { |
46 | 46 | return $areaHtml[$areaName]; |
47 | 47 | } |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | |
53 | 53 | add_filter('get_twig', $addArea); |
54 | 54 | |
55 | - $returnTimberPaths = function ($paths) use ($filePath) { |
|
55 | + $returnTimberPaths = function($paths) use ($filePath) { |
|
56 | 56 | array_unshift($paths, dirname($filePath)); |
57 | 57 | return $paths; |
58 | 58 | }; |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | function formatGallery($value) |
80 | 80 | { |
81 | 81 | if (!empty($value)) { |
82 | - $value = array_map(function ($image) { |
|
82 | + $value = array_map(function($image) { |
|
83 | 83 | return new Image($image); |
84 | 84 | }, $value); |
85 | 85 | } |
@@ -104,8 +104,8 @@ discard block |
||
104 | 104 | return $value; |
105 | 105 | } |
106 | 106 | |
107 | -add_action('timber/twig/filters', function ($twig) { |
|
108 | - $twig->addFunction(new \Twig_SimpleFunction('placeholderImage', function ($width, $height, $color = null) { |
|
107 | +add_action('timber/twig/filters', function($twig) { |
|
108 | + $twig->addFunction(new \Twig_SimpleFunction('placeholderImage', function($width, $height, $color = null) { |
|
109 | 109 | $colorRect = $color ? "<rect width='{$width}' height='{$height}' style='fill:$color' />" : ''; |
110 | 110 | $svg = "<svg width='{$width}' height='{$height}' xmlns='http://www.w3.org/2000/svg'>{$colorRect}</svg>"; |
111 | 111 | return "data:image/svg+xml;base64," . base64_encode($svg); |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | $k2 = 1; |
123 | 123 | $b = 1 / $n; |
124 | 124 | do { |
125 | - $b = 1/$b; |
|
125 | + $b = 1 / $b; |
|
126 | 126 | $a = floor($b); |
127 | 127 | $aux = $h1; |
128 | 128 | $h1 = $a * $h1 + $h2; |
@@ -144,8 +144,8 @@ discard block |
||
144 | 144 | return crypt(serialize($args), NONCE_SALT); |
145 | 145 | } |
146 | 146 | |
147 | -add_action('timber/twig/filters', function ($twig) { |
|
148 | - $twig->addFilter(new \Twig_SimpleFilter('resizeDynamic', function ($src, $w, $h = 0, $crop = 'default', $force = false) { |
|
147 | +add_action('timber/twig/filters', function($twig) { |
|
148 | + $twig->addFilter(new \Twig_SimpleFilter('resizeDynamic', function($src, $w, $h = 0, $crop = 'default', $force = false) { |
|
149 | 149 | $arguments = [ |
150 | 150 | 'src' => $src, |
151 | 151 | 'w' => $w, |