@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | |
16 | 16 | add_action('Flynt/afterRegisterFeatures', 'Flynt\Features\Acf\Loader::init'); |
17 | 17 | |
18 | -add_filter('pre_http_request', function ($preempt, $args, $url) { |
|
18 | +add_filter('pre_http_request', function($preempt, $args, $url) { |
|
19 | 19 | if (strpos($url, 'https://www.youtube.com/oembed') !== false || strpos($url, 'https://vimeo.com/api/oembed') !== false) { |
20 | 20 | $response = wp_cache_get($url, 'oembedCache'); |
21 | 21 | if (!empty($response)) { |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | return false; |
26 | 26 | }, 10, 3); |
27 | 27 | |
28 | -add_filter('http_response', function ($response, $args, $url) { |
|
28 | +add_filter('http_response', function($response, $args, $url) { |
|
29 | 29 | if (strpos($url, 'https://www.youtube.com/oembed') !== false || strpos($url, 'https://vimeo.com/api/oembed') !== false) { |
30 | 30 | wp_cache_set($url, $response, 'oembedCache'); |
31 | 31 | } |
@@ -14,7 +14,7 @@ |
||
14 | 14 | { |
15 | 15 | if (is_admin()) { |
16 | 16 | // adds buttons to collapse/expand components |
17 | - add_filter('acf/get_field_label', function ($label, $field) { |
|
17 | + add_filter('acf/get_field_label', function($label, $field) { |
|
18 | 18 | if ($field['type'] === 'flexible_content') { |
19 | 19 | $label .= '<span class="flexible-content-controls">'; |
20 | 20 | $label .= '<span class="flexible-content-control"><a class="acf-icon small -collapse collapse-all" title="collapse all"></a></span>'; |
@@ -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,11 +4,11 @@ |
||
4 | 4 | |
5 | 5 | use Flynt\Features\Components\Component; |
6 | 6 | |
7 | -add_filter('Flynt/addComponentData?name=GridDownloadPortrait', function ($data) { |
|
7 | +add_filter('Flynt/addComponentData?name=GridDownloadPortrait', function($data) { |
|
8 | 8 | Component::enqueueAssets('GridDownloadPortrait'); |
9 | 9 | |
10 | 10 | if (!empty($data['items'])) { |
11 | - $data['items'] = array_map(function ($item) { |
|
11 | + $data['items'] = array_map(function($item) { |
|
12 | 12 | if ($item['itemType'] === 'itemFile') { |
13 | 13 | $fileSize = filesize(get_attached_file($item['file']['id'])); |
14 | 14 | $item['file']['fileSize'] = size_format($fileSize); |
@@ -4,7 +4,7 @@ |
||
4 | 4 | |
5 | 5 | use Flynt\Features\Components\Component; |
6 | 6 | |
7 | -add_filter('Flynt/addComponentData?name=GridContentLists', function ($data) { |
|
7 | +add_filter('Flynt/addComponentData?name=GridContentLists', function($data) { |
|
8 | 8 | Component::enqueueAssets('GridContentLists'); |
9 | 9 | |
10 | 10 | return $data; |
@@ -4,7 +4,7 @@ |
||
4 | 4 | |
5 | 5 | use Flynt\Features\Components\Component; |
6 | 6 | |
7 | -add_filter('Flynt/addComponentData?name=HeroCta', function ($data) { |
|
7 | +add_filter('Flynt/addComponentData?name=HeroCta', function($data) { |
|
8 | 8 | Component::enqueueAssets('HeroCta'); |
9 | 9 | |
10 | 10 | return $data; |
@@ -4,7 +4,7 @@ |
||
4 | 4 | |
5 | 5 | use Flynt\Features\Components\Component; |
6 | 6 | |
7 | -add_filter('Flynt/addComponentData?name=GridPosts', function ($data, $parentData) { |
|
7 | +add_filter('Flynt/addComponentData?name=GridPosts', function($data, $parentData) { |
|
8 | 8 | Component::enqueueAssets('GridPosts'); |
9 | 9 | |
10 | 10 | $data['pagination'] = (isset($parentData['pagination'])) ? $parentData['pagination'] : null; |
@@ -4,7 +4,7 @@ |
||
4 | 4 | |
5 | 5 | use Flynt\Features\Components\Component; |
6 | 6 | |
7 | -add_filter('Flynt/addComponentData?name=BlockWysiwyg', function ($data) { |
|
7 | +add_filter('Flynt/addComponentData?name=BlockWysiwyg', function($data) { |
|
8 | 8 | Component::enqueueAssets('BlockWysiwyg'); |
9 | 9 | |
10 | 10 | return $data; |
@@ -4,7 +4,7 @@ |
||
4 | 4 | |
5 | 5 | use Flynt\Features\Components\Component; |
6 | 6 | |
7 | -add_filter('Flynt/addComponentData?name=ListPosts', function ($data, $parentData) { |
|
7 | +add_filter('Flynt/addComponentData?name=ListPosts', function($data, $parentData) { |
|
8 | 8 | Component::enqueueAssets('ListPosts'); |
9 | 9 | $data['isArchive'] = is_home() || is_archive(); |
10 | 10 |