@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | self::createOptionPages(); |
72 | 72 | |
73 | 73 | // Register Categories |
74 | - add_action('acf/init', function () { |
|
74 | + add_action('acf/init', function() { |
|
75 | 75 | self::addComponentSubPages(); |
76 | 76 | self::addFeatureSubPages(); |
77 | 77 | self::addCustomPostTypeSubPages(); |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | public static function addComponentData($data, $parentData, $config) |
150 | 150 | { |
151 | 151 | // get fields for this component |
152 | - $options = array_reduce(array_keys(self::$optionTypes), function ($carry, $optionType) use ($config) { |
|
152 | + $options = array_reduce(array_keys(self::$optionTypes), function($carry, $optionType) use ($config) { |
|
153 | 153 | return array_merge($carry, self::get($optionType, 'Component', $config['name'])); |
154 | 154 | }, []); |
155 | 155 | |
@@ -217,7 +217,7 @@ discard block |
||
217 | 217 | ]; |
218 | 218 | } |
219 | 219 | |
220 | - add_action('current_screen', function ($currentScreen) { |
|
220 | + add_action('current_screen', function($currentScreen) { |
|
221 | 221 | foreach (self::$optionTypes as $optionType => $option) { |
222 | 222 | $isTranslatable = $option['translatable']; |
223 | 223 | $toplevelPageId = 'toplevel_page_' . $optionType; |
@@ -231,7 +231,7 @@ discard block |
||
231 | 231 | add_filter('acf/settings/current_language', 'Flynt\Features\Acf\OptionPages::getDefaultAcfLanguage', 101); |
232 | 232 | |
233 | 233 | // hide language selector in admin bar |
234 | - add_action('wp_before_admin_bar_render', function () { |
|
234 | + add_action('wp_before_admin_bar_render', function() { |
|
235 | 235 | $adminBar = $GLOBALS['wp_admin_bar']; |
236 | 236 | $adminBar->remove_menu('WPML_ALS'); |
237 | 237 | }); |
@@ -328,7 +328,7 @@ discard block |
||
328 | 328 | |
329 | 329 | protected static function prefixFields($fields, $prefix) |
330 | 330 | { |
331 | - return array_map(function ($field) use ($prefix) { |
|
331 | + return array_map(function($field) use ($prefix) { |
|
332 | 332 | $field['name'] = $prefix . '_' . $field['name']; |
333 | 333 | return $field; |
334 | 334 | }, $fields); |
@@ -392,7 +392,7 @@ discard block |
||
392 | 392 | protected static function collectOptionsWithPrefix($options, $prefix) |
393 | 393 | { |
394 | 394 | $optionKeys = is_array($options) ? array_keys($options) : []; |
395 | - return array_reduce($optionKeys, function ($carry, $key) use ($options, $prefix) { |
|
395 | + return array_reduce($optionKeys, function($carry, $key) use ($options, $prefix) { |
|
396 | 396 | $count = 0; |
397 | 397 | $option = $options[$key]; |
398 | 398 | $key = str_replace($prefix, '', $key, $count); |
@@ -405,7 +405,7 @@ discard block |
||
405 | 405 | |
406 | 406 | protected static function combineArrayDefaults(array $array, array $defaults) |
407 | 407 | { |
408 | - return array_map(function ($value) use ($defaults) { |
|
408 | + return array_map(function($value) use ($defaults) { |
|
409 | 409 | return is_array($value) ? array_merge($defaults, $value) : []; |
410 | 410 | }, $array); |
411 | 411 | } |
@@ -5,7 +5,7 @@ discard block |
||
5 | 5 | use Timber\Timber; |
6 | 6 | use Flynt\Features\Components\Component; |
7 | 7 | |
8 | -add_action('wp_enqueue_scripts', function () { |
|
8 | +add_action('wp_enqueue_scripts', function() { |
|
9 | 9 | Component::enqueueAssets('DocumentDefault', [ |
10 | 10 | [ |
11 | 11 | 'name' => 'console-polyfill', |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | ]); |
36 | 36 | }, 0); |
37 | 37 | |
38 | -add_filter('Flynt/addComponentData?name=DocumentDefault', function ($data) { |
|
38 | +add_filter('Flynt/addComponentData?name=DocumentDefault', function($data) { |
|
39 | 39 | $context = Timber::get_context(); |
40 | 40 | |
41 | 41 | $output = [ |
@@ -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 | Asset::register([ |
9 | 9 | 'type' => 'script', |
10 | 10 | 'name' => 'Flynt/Features/Lodash', |
@@ -4,8 +4,8 @@ |
||
4 | 4 | |
5 | 5 | use Flynt\Features\Components\Component; |
6 | 6 | |
7 | -add_filter('Flynt/addComponentData?name=BlockBaseStyle', function ($data) { |
|
8 | - add_action('wp_enqueue_scripts', function () { |
|
7 | +add_filter('Flynt/addComponentData?name=BlockBaseStyle', function($data) { |
|
8 | + add_action('wp_enqueue_scripts', function() { |
|
9 | 9 | Component::enqueueAssets('BlockBaseStyle'); |
10 | 10 | }); |
11 | 11 | return $data; |
@@ -16,12 +16,12 @@ discard block |
||
16 | 16 | function disallowRobots() |
17 | 17 | { |
18 | 18 | if (defined('WPSEO_VERSION')) { |
19 | - add_filter('wpseo_robots', function () { |
|
19 | + add_filter('wpseo_robots', function() { |
|
20 | 20 | return "noindex,nofollow"; |
21 | 21 | }); |
22 | 22 | } else { |
23 | 23 | remove_action('wp_head', 'noindex', 1); |
24 | - add_action('wp_head', function () { |
|
24 | + add_action('wp_head', function() { |
|
25 | 25 | echo "<meta name='robots' content='noindex,nofollow' />\n"; |
26 | 26 | }); |
27 | 27 | } |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | |
37 | 37 | $rules = get_option('rewrite_rules'); |
38 | 38 | |
39 | - if (! isset($rules["{$routeName}/(.*?)/?$"])) { |
|
39 | + if (!isset($rules["{$routeName}/(.*?)/?$"])) { |
|
40 | 40 | flush_rewrite_rules(); |
41 | 41 | } |
42 | 42 | } |
@@ -4,8 +4,8 @@ |
||
4 | 4 | |
5 | 5 | use Flynt\Features\Components\Component; |
6 | 6 | |
7 | -add_filter('Flynt/addComponentData?name=BlockImageText', function ($data) { |
|
8 | - add_action('wp_enqueue_scripts', function () { |
|
7 | +add_filter('Flynt/addComponentData?name=BlockImageText', function($data) { |
|
8 | + add_action('wp_enqueue_scripts', function() { |
|
9 | 9 | Component::enqueueAssets('BlockImageText', [ |
10 | 10 | [ |
11 | 11 | 'name' => 'lazysizes', |
@@ -5,8 +5,8 @@ |
||
5 | 5 | use Flynt\Features\Components\Component; |
6 | 6 | use Flynt\Utils\Oembed; |
7 | 7 | |
8 | -add_filter('Flynt/addComponentData?name=BlockVideoOembed', function ($data) { |
|
9 | - add_action('wp_enqueue_scripts', function () { |
|
8 | +add_filter('Flynt/addComponentData?name=BlockVideoOembed', function($data) { |
|
9 | + add_action('wp_enqueue_scripts', function() { |
|
10 | 10 | Component::enqueueAssets('BlockVideoOembed', [ |
11 | 11 | [ |
12 | 12 | 'name' => 'lazysizes', |
@@ -4,8 +4,8 @@ |
||
4 | 4 | |
5 | 5 | use Flynt\Features\Components\Component; |
6 | 6 | |
7 | -add_filter('Flynt/addComponentData?name=BlockImage', function ($data) { |
|
8 | - add_action('wp_enqueue_scripts', function () { |
|
7 | +add_filter('Flynt/addComponentData?name=BlockImage', function($data) { |
|
8 | + add_action('wp_enqueue_scripts', function() { |
|
9 | 9 | Component::enqueueAssets('BlockImage', [ |
10 | 10 | [ |
11 | 11 | 'name' => 'lazysizes', |
@@ -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; |