@@ -7,19 +7,19 @@ discard block |
||
7 | 7 | use Timber\Menu; |
8 | 8 | use Flynt\Features\Acf\OptionPages; |
9 | 9 | |
10 | -add_action('wp_enqueue_scripts', function () { |
|
10 | +add_action('wp_enqueue_scripts', function() { |
|
11 | 11 | Component::enqueueAssets('NavigationMain'); |
12 | 12 | }); |
13 | 13 | |
14 | -add_filter('Flynt/addComponentData?name=NavigationMain', function ($data) { |
|
14 | +add_filter('Flynt/addComponentData?name=NavigationMain', function($data) { |
|
15 | 15 | // set max level of the menu |
16 | 16 | $data['maxLevel'] = 0; |
17 | 17 | $data['menuSlug'] = !empty($data['menuSlug']) ? $data['menuSlug'] : ''; |
18 | 18 | $data['menu'] = has_nav_menu($data['menuSlug']) ? new Menu($data['menuSlug']) : false; |
19 | 19 | |
20 | 20 | if (!empty($data['menu'])) { |
21 | - $data['menu']->items = array_map(function ($item) { |
|
22 | - $item->btnClasses = array_filter($item->classes, function ($class) { |
|
21 | + $data['menu']->items = array_map(function($item) { |
|
22 | + $item->btnClasses = array_filter($item->classes, function($class) { |
|
23 | 23 | return stripos(trim($class), 'btn') === 0; |
24 | 24 | }); |
25 | 25 | $item->classes = array_diff($item->classes, $item->btnClasses); |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | return $data; |
33 | 33 | }); |
34 | 34 | |
35 | -add_action('init', function () { |
|
35 | +add_action('init', function() { |
|
36 | 36 | register_nav_menus([ |
37 | 37 | 'navigation_main' => __('Navigation Main', 'flynt-starter-theme') |
38 | 38 | ]); |
@@ -4,8 +4,8 @@ |
||
4 | 4 | |
5 | 5 | use Flynt\Features\Components\Component; |
6 | 6 | |
7 | -add_filter('Flynt/addComponentData?name=AccordionDefault', function ($data) { |
|
8 | - add_action('wp_enqueue_scripts', function () { |
|
7 | +add_filter('Flynt/addComponentData?name=AccordionDefault', function($data) { |
|
8 | + add_action('wp_enqueue_scripts', function() { |
|
9 | 9 | Component::enqueueAssets('AccordionDefault'); |
10 | 10 | }); |
11 | 11 | return $data; |
@@ -4,8 +4,8 @@ |
||
4 | 4 | |
5 | 5 | use Flynt\Features\Components\Component; |
6 | 6 | |
7 | -add_filter('Flynt/addComponentData?name=SliderImageGallery', function ($data) { |
|
8 | - add_action('wp_enqueue_scripts', function () { |
|
7 | +add_filter('Flynt/addComponentData?name=SliderImageGallery', function($data) { |
|
8 | + add_action('wp_enqueue_scripts', function() { |
|
9 | 9 | Component::enqueueAssets('SliderImageGallery', [ |
10 | 10 | [ |
11 | 11 | 'name' => 'slick-carousel', |
@@ -4,8 +4,8 @@ |
||
4 | 4 | |
5 | 5 | use Flynt\Features\Components\Component; |
6 | 6 | |
7 | -add_filter('Flynt/addComponentData?name=SliderImages', function ($data) { |
|
8 | - add_action('wp_enqueue_scripts', function () { |
|
7 | +add_filter('Flynt/addComponentData?name=SliderImages', function($data) { |
|
8 | + add_action('wp_enqueue_scripts', function() { |
|
9 | 9 | Component::enqueueAssets('SliderImages', [ |
10 | 10 | [ |
11 | 11 | 'name' => 'slick-carousel', |
@@ -4,8 +4,8 @@ |
||
4 | 4 | use Flynt\Features\Acf\OptionPages; |
5 | 5 | use Flynt\Features\Components\Component; |
6 | 6 | |
7 | -add_filter('Flynt/addComponentData?name=BlockCookieNotice', function ($data) { |
|
8 | - add_action('wp_enqueue_scripts', function () { |
|
7 | +add_filter('Flynt/addComponentData?name=BlockCookieNotice', function($data) { |
|
8 | + add_action('wp_enqueue_scripts', function() { |
|
9 | 9 | Component::enqueueAssets('BlockCookieNotice', [ |
10 | 10 | [ |
11 | 11 | 'name' => 'js-cookie', |
@@ -5,8 +5,8 @@ |
||
5 | 5 | use Timber\Timber; |
6 | 6 | use Timber\Post; |
7 | 7 | |
8 | -add_filter('Flynt/addComponentData?name=ListPostCards', function ($data) { |
|
9 | - add_action('wp_enqueue_scripts', function () { |
|
8 | +add_filter('Flynt/addComponentData?name=ListPostCards', function($data) { |
|
9 | + add_action('wp_enqueue_scripts', function() { |
|
10 | 10 | Component::enqueueAssets('ListPostCards'); |
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=HeroCta', function ($data) { |
|
8 | - add_action('wp_enqueue_scripts', function () { |
|
7 | +add_filter('Flynt/addComponentData?name=HeroCta', function($data) { |
|
8 | + add_action('wp_enqueue_scripts', function() { |
|
9 | 9 | Component::enqueueAssets('HeroCta'); |
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=HeroImageText', function ($data) { |
|
8 | - add_action('wp_enqueue_scripts', function () { |
|
7 | +add_filter('Flynt/addComponentData?name=HeroImageText', function($data) { |
|
8 | + add_action('wp_enqueue_scripts', function() { |
|
9 | 9 | Component::enqueueAssets('HeroImageText'); |
10 | 10 | }); |
11 | 11 |
@@ -36,9 +36,9 @@ discard block |
||
36 | 36 | return $output; |
37 | 37 | } |
38 | 38 | |
39 | - $addArea = function ($twig) use ($areaHtml) { |
|
39 | + $addArea = function($twig) use ($areaHtml) { |
|
40 | 40 | |
41 | - $twig->addFunction(new Twig_SimpleFunction('area', function ($areaName) use ($areaHtml) { |
|
41 | + $twig->addFunction(new Twig_SimpleFunction('area', function($areaName) use ($areaHtml) { |
|
42 | 42 | if (array_key_exists($areaName, $areaHtml)) { |
43 | 43 | return $areaHtml[$areaName]; |
44 | 44 | } |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | |
50 | 50 | add_filter('get_twig', $addArea); |
51 | 51 | |
52 | - $returnTimberPaths = function ($paths) use ($filePath) { |
|
52 | + $returnTimberPaths = function($paths) use ($filePath) { |
|
53 | 53 | array_unshift($paths, dirname($filePath)); |
54 | 54 | return $paths; |
55 | 55 | }; |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | function formatGallery($value) |
77 | 77 | { |
78 | 78 | if (!empty($value)) { |
79 | - $value = array_map(function ($image) { |
|
79 | + $value = array_map(function($image) { |
|
80 | 80 | return new Image($image); |
81 | 81 | }, $value); |
82 | 82 | } |
@@ -101,8 +101,8 @@ discard block |
||
101 | 101 | return $value; |
102 | 102 | } |
103 | 103 | |
104 | -add_action('timber/twig/filters', function ($twig) { |
|
105 | - $twig->addFunction(new \Twig_SimpleFunction('transparentPng', function ($aspect, $r = 0, $g = 0, $b = 0, $a = 127) { |
|
104 | +add_action('timber/twig/filters', function($twig) { |
|
105 | + $twig->addFunction(new \Twig_SimpleFunction('transparentPng', function($aspect, $r = 0, $g = 0, $b = 0, $a = 127) { |
|
106 | 106 | $ratio = aspectToRatio($aspect); |
107 | 107 | //create image with specified sizes |
108 | 108 | $image = imagecreatetruecolor($ratio['width'], $ratio['height']); |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | $k2 = 1; |
132 | 132 | $b = 1 / $n; |
133 | 133 | do { |
134 | - $b = 1/$b; |
|
134 | + $b = 1 / $b; |
|
135 | 135 | $a = floor($b); |
136 | 136 | $aux = $h1; |
137 | 137 | $h1 = $a * $h1 + $h2; |
@@ -153,8 +153,8 @@ discard block |
||
153 | 153 | return crypt(serialize($args), NONCE_SALT); |
154 | 154 | } |
155 | 155 | |
156 | -add_action('timber/twig/filters', function ($twig) { |
|
157 | - $twig->addFilter(new \Twig_SimpleFilter('resizeDynamic', function ($src, $w, $h = 0, $crop = 'default', $force = false) { |
|
156 | +add_action('timber/twig/filters', function($twig) { |
|
157 | + $twig->addFilter(new \Twig_SimpleFilter('resizeDynamic', function($src, $w, $h = 0, $crop = 'default', $force = false) { |
|
158 | 158 | $arguments = [ |
159 | 159 | 'src' => $src, |
160 | 160 | 'w' => $w, |