@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | |
33 | 33 | public static function setTemplateDirectory() |
34 | 34 | { |
35 | - add_action('after_switch_theme', function () { |
|
35 | + add_action('after_switch_theme', function() { |
|
36 | 36 | $stylesheet = get_option('stylesheet'); |
37 | 37 | |
38 | 38 | if (basename($stylesheet) !== 'templates') { |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | } |
41 | 41 | }); |
42 | 42 | |
43 | - add_filter('stylesheet', function ($stylesheet) { |
|
43 | + add_filter('stylesheet', function($stylesheet) { |
|
44 | 44 | return dirname($stylesheet); |
45 | 45 | }); |
46 | 46 | } |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | |
52 | 52 | if (!$acfActive) { |
53 | 53 | self::notifyRequiredPluginIsMissing('ACF'); |
54 | - add_filter('template_include', function () { |
|
54 | + add_filter('template_include', function() { |
|
55 | 55 | die( |
56 | 56 | 'One or more required plugins are not activated! Please <a href="' |
57 | 57 | . esc_url(admin_url('plugins.php')) |
@@ -3,7 +3,7 @@ discard block |
||
3 | 3 | |
4 | 4 | use Flynt\Utils\Options; |
5 | 5 | |
6 | -add_filter('pre_http_request', function ($preempt, $args, $url) { |
|
6 | +add_filter('pre_http_request', function($preempt, $args, $url) { |
|
7 | 7 | if (strpos($url, 'https://www.youtube.com/oembed') !== false || strpos($url, 'https://vimeo.com/api/oembed') !== false) { |
8 | 8 | $response = wp_cache_get($url, 'oembedCache'); |
9 | 9 | if (!empty($response)) { |
@@ -13,14 +13,14 @@ discard block |
||
13 | 13 | return false; |
14 | 14 | }, 10, 3); |
15 | 15 | |
16 | -add_filter('http_response', function ($response, $args, $url) { |
|
16 | +add_filter('http_response', function($response, $args, $url) { |
|
17 | 17 | if (strpos($url, 'https://www.youtube.com/oembed') !== false || strpos($url, 'https://vimeo.com/api/oembed') !== false) { |
18 | 18 | wp_cache_set($url, $response, 'oembedCache'); |
19 | 19 | } |
20 | 20 | return $response; |
21 | 21 | }, 10, 3); |
22 | 22 | |
23 | -add_filter('acf/fields/google_map/api', function ($api) { |
|
23 | +add_filter('acf/fields/google_map/api', function($api) { |
|
24 | 24 | $apiKey = Options::get('globalOptions', 'component', 'Acf', 'googleMapsApiKey'); |
25 | 25 | if ($apiKey) { |
26 | 26 | $api['key'] = $apiKey; |
@@ -6,13 +6,13 @@ |
||
6 | 6 | use Flynt\Utils\Asset; |
7 | 7 | use Flynt\Utils\Options; |
8 | 8 | |
9 | -add_action('init', function () { |
|
9 | +add_action('init', function() { |
|
10 | 10 | register_nav_menus([ |
11 | 11 | 'navigation_burger' => __('Navigation Burger', 'flynt') |
12 | 12 | ]); |
13 | 13 | }); |
14 | 14 | |
15 | -add_filter('Flynt/addComponentData?name=NavigationBurger', function ($data) { |
|
15 | +add_filter('Flynt/addComponentData?name=NavigationBurger', function($data) { |
|
16 | 16 | $data['menu'] = new Timber\Menu('navigation_burger'); |
17 | 17 | $data['logo'] = [ |
18 | 18 | 'src' => Asset::requireUrl( |
@@ -5,13 +5,13 @@ |
||
5 | 5 | use Timber; |
6 | 6 | use Flynt\Utils\Asset; |
7 | 7 | |
8 | -add_action('init', function () { |
|
8 | +add_action('init', function() { |
|
9 | 9 | register_nav_menus([ |
10 | 10 | 'navigation_main' => __('Navigation Main', 'flynt') |
11 | 11 | ]); |
12 | 12 | }); |
13 | 13 | |
14 | -add_filter('Flynt/addComponentData?name=NavigationMain', function ($data) { |
|
14 | +add_filter('Flynt/addComponentData?name=NavigationMain', function($data) { |
|
15 | 15 | $data['menu'] = new Timber\Menu('navigation_main'); |
16 | 16 | $data['logo'] = [ |
17 | 17 | 'src' => Asset::requireUrl('Components/NavigationMain/Assets/logo.svg'), |
@@ -5,7 +5,7 @@ |
||
5 | 5 | use Flynt\Api; |
6 | 6 | use Flynt\Utils\Options; |
7 | 7 | |
8 | -add_filter('Flynt/addComponentData?name=SliderImages', function ($data) { |
|
8 | +add_filter('Flynt/addComponentData?name=SliderImages', function($data) { |
|
9 | 9 | $translatableOptions = Options::get('translatableOptions', 'feature', 'SliderOptions'); |
10 | 10 | $data['jsonData'] = [ |
11 | 11 | 'options' => array_merge($translatableOptions, $data['options']), |
@@ -5,7 +5,7 @@ |
||
5 | 5 | use Flynt\Api; |
6 | 6 | use Flynt\Utils\Options; |
7 | 7 | |
8 | -add_filter('Flynt/addComponentData?name=SliderImagesCentered', function ($data) { |
|
8 | +add_filter('Flynt/addComponentData?name=SliderImagesCentered', function($data) { |
|
9 | 9 | $translatableOptions = Options::get('translatableOptions', 'feature', 'SliderOptions'); |
10 | 10 | $data['jsonData'] = [ |
11 | 11 | 'options' => array_merge($translatableOptions, $data['options']), |
@@ -6,7 +6,7 @@ |
||
6 | 6 | use Timber\Timber; |
7 | 7 | use Flynt\Utils\Options; |
8 | 8 | |
9 | -add_filter('Flynt/addComponentData?name=GridPostsSlider', function ($data) { |
|
9 | +add_filter('Flynt/addComponentData?name=GridPostsSlider', function($data) { |
|
10 | 10 | $posts = Timber::get_posts([ |
11 | 11 | 'post_type' => 'post', |
12 | 12 | 'posts_per_page' => -1, |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | namespace Flynt\TinyMce; |
10 | 10 | |
11 | 11 | // First Toolbar |
12 | -add_filter('mce_buttons', function ($buttons) { |
|
12 | +add_filter('mce_buttons', function($buttons) { |
|
13 | 13 | $config = getConfig(); |
14 | 14 | if ($config && isset($config['toolbars'])) { |
15 | 15 | $toolbars = $config['toolbars']; |
@@ -21,11 +21,11 @@ discard block |
||
21 | 21 | }); |
22 | 22 | |
23 | 23 | // Second Toolbar |
24 | -add_filter('mce_buttons_2', function ($buttons) { |
|
24 | +add_filter('mce_buttons_2', function($buttons) { |
|
25 | 25 | return []; |
26 | 26 | }); |
27 | 27 | |
28 | -add_filter('tiny_mce_before_init', function ($init) { |
|
28 | +add_filter('tiny_mce_before_init', function($init) { |
|
29 | 29 | $config = getConfig(); |
30 | 30 | if ($config) { |
31 | 31 | if (isset($config['blockformats'])) { |
@@ -40,11 +40,11 @@ discard block |
||
40 | 40 | return $init; |
41 | 41 | }); |
42 | 42 | |
43 | -add_filter('acf/fields/wysiwyg/toolbars', function ($toolbars) { |
|
43 | +add_filter('acf/fields/wysiwyg/toolbars', function($toolbars) { |
|
44 | 44 | // Load Toolbars and parse them into TinyMCE |
45 | 45 | $config = getConfig(); |
46 | 46 | if ($config && !empty($config['toolbars'])) { |
47 | - $toolbars = array_map(function ($toolbar) { |
|
47 | + $toolbars = array_map(function($toolbar) { |
|
48 | 48 | array_unshift($toolbar, []); |
49 | 49 | return $toolbar; |
50 | 50 | }, $config['toolbars']); |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | { |
57 | 57 | if (!empty($blockFormats)) { |
58 | 58 | $blockFormatStrings = array_map( |
59 | - function ($tag, $label) { |
|
59 | + function($tag, $label) { |
|
60 | 60 | return "${label}=${tag}"; |
61 | 61 | }, |
62 | 62 | $blockFormats, |
@@ -5,7 +5,7 @@ |
||
5 | 5 | use Flynt\Api; |
6 | 6 | use Flynt\Utils\Options; |
7 | 7 | |
8 | -add_filter('Flynt/addComponentData?name=SliderImageGallery', function ($data) { |
|
8 | +add_filter('Flynt/addComponentData?name=SliderImageGallery', function($data) { |
|
9 | 9 | $data['jsonData'] = [ |
10 | 10 | 'options' => Options::get('translatableOptions', 'feature', 'SliderOptions') |
11 | 11 | ]; |