@@ -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, |
@@ -6,15 +6,15 @@ |
||
| 6 | 6 | use Flynt\Features\Components\Component; |
| 7 | 7 | use WP_Query; |
| 8 | 8 | |
| 9 | -add_action('wp_enqueue_scripts', function () { |
|
| 9 | +add_action('wp_enqueue_scripts', function() { |
|
| 10 | 10 | Component::enqueueAssets('LayoutMultiplePosts'); |
| 11 | 11 | }); |
| 12 | 12 | |
| 13 | -add_filter('Flynt/addComponentData?name=LayoutMultiplePosts', function ($data) { |
|
| 13 | +add_filter('Flynt/addComponentData?name=LayoutMultiplePosts', function($data) { |
|
| 14 | 14 | $query = !empty($data['query']) ? $data['query'] : false; |
| 15 | 15 | $posts = Timber::get_posts($query); |
| 16 | 16 | if (!empty($posts)) { |
| 17 | - $posts = array_map(function ($post) { |
|
| 17 | + $posts = array_map(function($post) { |
|
| 18 | 18 | $fields = get_fields($post->id); |
| 19 | 19 | $post->fields = $fields === false ? [] : $fields; |
| 20 | 20 | return $post; |
@@ -4,8 +4,8 @@ |
||
| 4 | 4 | |
| 5 | 5 | use Flynt\Features\Components\Component; |
| 6 | 6 | |
| 7 | -add_filter('Flynt/addComponentData?name=ListSearchResults', function ($data, $parentData) { |
|
| 8 | - add_action('wp_enqueue_scripts', function () { |
|
| 7 | +add_filter('Flynt/addComponentData?name=ListSearchResults', function($data, $parentData) { |
|
| 8 | + add_action('wp_enqueue_scripts', function() { |
|
| 9 | 9 | Component::enqueueAssets('ListSearchResults'); |
| 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=GridContentLists', function ($data) { |
|
| 8 | - add_action('wp_enqueue_scripts', function () { |
|
| 7 | +add_filter('Flynt/addComponentData?name=GridContentLists', function($data) { |
|
| 8 | + add_action('wp_enqueue_scripts', function() { |
|
| 9 | 9 | Component::enqueueAssets('GridContentLists'); |
| 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=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 | |
@@ -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 | |