@@ -17,18 +17,18 @@ |
||
17 | 17 | // only converts first dimension of object |
18 | 18 | public static function objectToArray($obj) |
19 | 19 | { |
20 | - return array_map(function ($val) { |
|
20 | + return array_map(function($val) { |
|
21 | 21 | return (array) $val; |
22 | 22 | }, $obj); |
23 | 23 | } |
24 | 24 | |
25 | 25 | public static function indexedValuesToAssocKeys(array $array) |
26 | 26 | { |
27 | - $values = array_map(function ($value) { |
|
27 | + $values = array_map(function($value) { |
|
28 | 28 | return is_array($value) ? $value : []; |
29 | 29 | }, $array); |
30 | 30 | |
31 | - $keys = array_map(function ($key) use ($array) { |
|
31 | + $keys = array_map(function($key) use ($array) { |
|
32 | 32 | return is_int($key) ? $array[$key] : $key; |
33 | 33 | }, array_keys($array)); |
34 | 34 |
@@ -4,11 +4,11 @@ |
||
4 | 4 | use Flynt\Features\Components\Component; |
5 | 5 | use Flynt\Utils\DomNode; |
6 | 6 | |
7 | -add_action('wp_enqueue_scripts', function () { |
|
7 | +add_action('wp_enqueue_scripts', function() { |
|
8 | 8 | Component::enqueueAssets('BlockMediaText'); |
9 | 9 | }); |
10 | 10 | |
11 | -add_filter('Flynt/addComponentData?name=BlockMediaText', function ($data) { |
|
11 | +add_filter('Flynt/addComponentData?name=BlockMediaText', function($data) { |
|
12 | 12 | if ($data['mediaType'] === 'mediaVideo') { |
13 | 13 | $data['oembedLazyLoad'] = DomNode::setSrcDataAttribute( |
14 | 14 | $data['oembed'], |
@@ -4,6 +4,6 @@ |
||
4 | 4 | |
5 | 5 | use Flynt\Features\Components\Component; |
6 | 6 | |
7 | -add_action('wp_enqueue_scripts', function () { |
|
7 | +add_action('wp_enqueue_scripts', function() { |
|
8 | 8 | Component::enqueueAssets('BlockImage'); |
9 | 9 | }); |
@@ -4,11 +4,11 @@ |
||
4 | 4 | use Flynt\Features\Components\Component; |
5 | 5 | use Flynt\Utils\DomNode; |
6 | 6 | |
7 | -add_action('wp_enqueue_scripts', function () { |
|
7 | +add_action('wp_enqueue_scripts', function() { |
|
8 | 8 | Component::enqueueAssets('BlockVideoOembed'); |
9 | 9 | }); |
10 | 10 | |
11 | -add_filter('Flynt/addComponentData?name=BlockVideoOembed', function ($data) { |
|
11 | +add_filter('Flynt/addComponentData?name=BlockVideoOembed', function($data) { |
|
12 | 12 | $data['oembedLazyLoad'] = DomNode::setSrcDataAttribute( |
13 | 13 | $data['oembed'], |
14 | 14 | 'iframe', |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | use Timber\Post; |
9 | 9 | use Flynt\Utils\Log; |
10 | 10 | |
11 | -add_filter('Flynt/addComponentData?name=ListProducts', function ($data) { |
|
11 | +add_filter('Flynt/addComponentData?name=ListProducts', function($data) { |
|
12 | 12 | $defaultCount = OptionPages::getOption('globalOptions', 'customPostType', 'product', 'defaultProductsNumber'); |
13 | 13 | $data['productTypesLabel'] = OptionPages::getOption('translatableOptions', 'customPostType', 'product', 'productTypesLabel'); |
14 | 14 | $data['overviewPage'] = OptionPages::getOption('translatableOptions', 'customPostType', 'product', 'overviewPage'); |
@@ -30,6 +30,6 @@ discard block |
||
30 | 30 | return $data; |
31 | 31 | }); |
32 | 32 | |
33 | -add_action('wp_enqueue_scripts', function () { |
|
33 | +add_action('wp_enqueue_scripts', function() { |
|
34 | 34 | Component::enqueueAssets('ListProducts'); |
35 | 35 | }); |
@@ -33,19 +33,19 @@ |
||
33 | 33 | add_action('wp_enqueue_scripts', function () { |
34 | 34 | Component::enqueueAssets('SliderMedia', [ |
35 | 35 | [ |
36 | - 'name' => 'normalize', |
|
37 | - 'path' => 'vendor/normalize.css', |
|
38 | - 'type' => 'style' |
|
36 | + 'name' => 'normalize', |
|
37 | + 'path' => 'vendor/normalize.css', |
|
38 | + 'type' => 'style' |
|
39 | 39 | ], |
40 | 40 | [ |
41 | - 'name' => 'slick-carousel', |
|
42 | - 'path' => 'vendor/slick.js', |
|
43 | - 'type' => 'script' |
|
41 | + 'name' => 'slick-carousel', |
|
42 | + 'path' => 'vendor/slick.js', |
|
43 | + 'type' => 'script' |
|
44 | 44 | ], |
45 | 45 | [ |
46 | - 'name' => 'slick-carousel', |
|
47 | - 'path' => 'vendor/slick.css', |
|
48 | - 'type' => 'style' |
|
46 | + 'name' => 'slick-carousel', |
|
47 | + 'path' => 'vendor/slick.css', |
|
48 | + 'type' => 'style' |
|
49 | 49 | ] |
50 | 50 | ]); |
51 | 51 | }); |
@@ -4,8 +4,8 @@ discard block |
||
4 | 4 | use Flynt\Features\Components\Component; |
5 | 5 | use Flynt\Utils\DomNode; |
6 | 6 | |
7 | -add_filter('Flynt/addComponentData?name=SliderMedia', function ($data) { |
|
8 | - $data['mediaSlides'] = array_map(function ($item) { |
|
7 | +add_filter('Flynt/addComponentData?name=SliderMedia', function($data) { |
|
8 | + $data['mediaSlides'] = array_map(function($item) { |
|
9 | 9 | if ($item['mediaType'] == 'oembed') { |
10 | 10 | $item['oembedLazyLoad'] = DomNode::setSrcDataAttribute( |
11 | 11 | $item['oembed'], |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | return $data; |
31 | 31 | }); |
32 | 32 | |
33 | -add_action('wp_enqueue_scripts', function () { |
|
33 | +add_action('wp_enqueue_scripts', function() { |
|
34 | 34 | Component::enqueueAssets('SliderMedia', [ |
35 | 35 | [ |
36 | 36 | 'name' => 'normalize', |
@@ -4,7 +4,7 @@ |
||
4 | 4 | |
5 | 5 | use Timber\Menu; |
6 | 6 | |
7 | -add_filter('Flynt/addComponentData?name=NavigationMain', function ($data) { |
|
7 | +add_filter('Flynt/addComponentData?name=NavigationMain', function($data) { |
|
8 | 8 | $data['menuSlug'] = !empty($data['menuSlug']) ? $data['menuSlug'] : ''; |
9 | 9 | $data['menu'] = new Menu($data['menuSlug']); |
10 | 10 | return $data; |
@@ -3,6 +3,6 @@ |
||
3 | 3 | |
4 | 4 | use Flynt\Features\Components\Component; |
5 | 5 | |
6 | -add_action('wp_enqueue_scripts', function () { |
|
6 | +add_action('wp_enqueue_scripts', function() { |
|
7 | 7 | Component::enqueueAssets('BlockWysiwyg'); |
8 | 8 | }); |
@@ -6,11 +6,11 @@ |
||
6 | 6 | use Flynt\Features\Acf\OptionPages; |
7 | 7 | use Flynt\Features\Components\Component; |
8 | 8 | |
9 | -add_action('wp_enqueue_scripts', function () { |
|
9 | +add_action('wp_enqueue_scripts', function() { |
|
10 | 10 | Component::enqueueAssets('LayoutSingleProduct'); |
11 | 11 | }); |
12 | 12 | |
13 | -add_filter('Flynt/addComponentData?name=LayoutSingleProduct', function ($data) { |
|
13 | +add_filter('Flynt/addComponentData?name=LayoutSingleProduct', function($data) { |
|
14 | 14 | $query = !empty($data['query']) ? $data['query'] : false; |
15 | 15 | $post = Timber::get_post($query); |
16 | 16 | if (!empty($post)) { |