@@ -12,10 +12,10 @@ discard block |
||
12 | 12 | // register all components |
13 | 13 | $componentPath = trailingslashit(Feature::getOption('flynt-components', 0)); |
14 | 14 | |
15 | -add_action('Flynt/afterRegisterFeatures', function () use ($componentPath) { |
|
15 | +add_action('Flynt/afterRegisterFeatures', function() use ($componentPath) { |
|
16 | 16 | if (is_dir($componentPath)) { |
17 | 17 | $components = []; |
18 | - FileLoader::iterateDir($componentPath, function ($dir) use (&$components) { |
|
18 | + FileLoader::iterateDir($componentPath, function($dir) use (&$components) { |
|
19 | 19 | if ($dir->isDir()) { |
20 | 20 | $components[] = $dir->getFilename(); |
21 | 21 | } |
@@ -26,6 +26,6 @@ discard block |
||
26 | 26 | }); |
27 | 27 | |
28 | 28 | // set Component Path |
29 | -add_filter('Flynt/componentPath', function ($defaultPath, $componentName) use ($componentPath) { |
|
29 | +add_filter('Flynt/componentPath', function($defaultPath, $componentName) use ($componentPath) { |
|
30 | 30 | return $componentPath . $componentName; |
31 | 31 | }, 10, 2); |
@@ -6,7 +6,7 @@ |
||
6 | 6 | { |
7 | 7 | public static function init() |
8 | 8 | { |
9 | - add_filter('acf/fields/google_map/api', function ($api) { |
|
9 | + add_filter('acf/fields/google_map/api', function($api) { |
|
10 | 10 | $apiKey = OptionPages::get('globalOptions', 'feature', 'Acf', 'googleMapsApiKey'); |
11 | 11 | if ($apiKey) { |
12 | 12 | $api['key'] = $apiKey; |
@@ -5,11 +5,11 @@ |
||
5 | 5 | use Flynt\Features\Components\Component; |
6 | 6 | use Timber\Menu; |
7 | 7 | |
8 | -add_action('wp_enqueue_scripts', function () { |
|
8 | +add_action('wp_enqueue_scripts', function() { |
|
9 | 9 | Component::enqueueAssets('NavigationMain'); |
10 | 10 | }); |
11 | 11 | |
12 | -add_filter('Flynt/addComponentData?name=NavigationMain', function ($data) { |
|
12 | +add_filter('Flynt/addComponentData?name=NavigationMain', function($data) { |
|
13 | 13 | // set max level of the menu |
14 | 14 | $data['maxLevel'] = 0; |
15 | 15 | $data['menuSlug'] = !empty($data['menuSlug']) ? $data['menuSlug'] : ''; |
@@ -4,11 +4,11 @@ |
||
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('ListPosts'); |
9 | 9 | }); |
10 | 10 | |
11 | -add_filter('Flynt/addComponentData?name=ListPosts', function ($data, $parentData) { |
|
11 | +add_filter('Flynt/addComponentData?name=ListPosts', function($data, $parentData) { |
|
12 | 12 | $data['isArchive'] = is_home() || is_archive(); |
13 | 13 | |
14 | 14 | $data['pagination'] = (isset($parentData['pagination'])) ? $parentData['pagination'] : null; |
@@ -5,11 +5,11 @@ |
||
5 | 5 | use Flynt\Features\Components\Component; |
6 | 6 | use Flynt\Utils\Oembed; |
7 | 7 | |
8 | -add_action('wp_enqueue_scripts', function () { |
|
8 | +add_action('wp_enqueue_scripts', function() { |
|
9 | 9 | Component::enqueueAssets('BlockMediaText'); |
10 | 10 | }); |
11 | 11 | |
12 | -add_filter('Flynt/addComponentData?name=BlockMediaText', function ($data) { |
|
12 | +add_filter('Flynt/addComponentData?name=BlockMediaText', function($data) { |
|
13 | 13 | if ($data['mediaType'] === 'oembedVideo') { |
14 | 14 | $data['oembedLazyLoad'] = Oembed::setSrcAsDataAttribute( |
15 | 15 | $data['oembed'], |
@@ -5,11 +5,11 @@ |
||
5 | 5 | use Flynt\Features\Components\Component; |
6 | 6 | use Flynt\Utils\Oembed; |
7 | 7 | |
8 | -add_action('wp_enqueue_scripts', function () { |
|
8 | +add_action('wp_enqueue_scripts', function() { |
|
9 | 9 | Component::enqueueAssets('BlockVideoOembed'); |
10 | 10 | }); |
11 | 11 | |
12 | -add_filter('Flynt/addComponentData?name=BlockVideoOembed', function ($data) { |
|
12 | +add_filter('Flynt/addComponentData?name=BlockVideoOembed', function($data) { |
|
13 | 13 | $data['oembedLazyLoad'] = Oembed::setSrcAsDataAttribute( |
14 | 14 | $data['oembed'], |
15 | 15 | [ |
@@ -5,7 +5,7 @@ |
||
5 | 5 | use Flynt\Utils\Asset; |
6 | 6 | use Flynt\Utils\Feature; |
7 | 7 | |
8 | -add_action('wp_enqueue_scripts', function () { |
|
8 | +add_action('wp_enqueue_scripts', function() { |
|
9 | 9 | $jqueryVersion = wp_scripts()->registered['jquery']->ver; |
10 | 10 | wp_deregister_script('jquery'); |
11 | 11 |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | // Load TinyMCE Settings from config file |
9 | 9 | |
10 | 10 | // First Toolbar |
11 | -add_filter('mce_buttons', function ($buttons) { |
|
11 | +add_filter('mce_buttons', function($buttons) { |
|
12 | 12 | $config = getConfig(); |
13 | 13 | if ($config && isset($config['toolbars'])) { |
14 | 14 | $toolbars = $config['toolbars']; |
@@ -20,11 +20,11 @@ discard block |
||
20 | 20 | }); |
21 | 21 | |
22 | 22 | // Second Toolbar |
23 | -add_filter('mce_buttons_2', function ($buttons) { |
|
23 | +add_filter('mce_buttons_2', function($buttons) { |
|
24 | 24 | return []; |
25 | 25 | }); |
26 | 26 | |
27 | -add_filter('tiny_mce_before_init', function ($init) { |
|
27 | +add_filter('tiny_mce_before_init', function($init) { |
|
28 | 28 | $config = getConfig(); |
29 | 29 | if ($config) { |
30 | 30 | if (isset($config['blockformats'])) { |
@@ -39,11 +39,11 @@ discard block |
||
39 | 39 | return $init; |
40 | 40 | }); |
41 | 41 | |
42 | -add_filter('acf/fields/wysiwyg/toolbars', function ($toolbars) { |
|
42 | +add_filter('acf/fields/wysiwyg/toolbars', function($toolbars) { |
|
43 | 43 | // Load Toolbars and parse them into TinyMCE |
44 | 44 | $config = getConfig(); |
45 | 45 | if ($config && !empty($config['toolbars'])) { |
46 | - $toolbars = array_map(function ($toolbar) { |
|
46 | + $toolbars = array_map(function($toolbar) { |
|
47 | 47 | array_unshift($toolbar, []); |
48 | 48 | return $toolbar; |
49 | 49 | }, $config['toolbars']); |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | function getBlockFormats($blockFormats) |
65 | 65 | { |
66 | 66 | if (!empty($blockFormats)) { |
67 | - $blockFormatStrings = array_map(function ($tag, $label) { |
|
67 | + $blockFormatStrings = array_map(function($tag, $label) { |
|
68 | 68 | return "${label}=${tag}"; |
69 | 69 | }, $blockFormats, array_keys($blockFormats)); |
70 | 70 | return implode($blockFormatStrings, ';'); |
@@ -38,7 +38,7 @@ |
||
38 | 38 | return; |
39 | 39 | } |
40 | 40 | |
41 | - FileLoader::iterateDir($dir, function ($file) { |
|
41 | + FileLoader::iterateDir($dir, function($file) { |
|
42 | 42 | if ($file->getExtension() === 'json') { |
43 | 43 | $filePath = $file->getPathname(); |
44 | 44 | $config = json_decode(file_get_contents($filePath), true); |