@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | define(__NAMESPACE__ . '\NS', __NAMESPACE__ . '\\'); |
12 | 12 | |
13 | 13 | // Render Component with Timber (Twig) |
14 | -add_filter('Flynt/renderComponent', function ($output, $componentName, $componentData, $areaHtml) { |
|
14 | +add_filter('Flynt/renderComponent', function($output, $componentName, $componentData, $areaHtml) { |
|
15 | 15 | // get index file |
16 | 16 | $componentManager = Flynt\ComponentManager::getInstance(); |
17 | 17 | $filePath = $componentManager->getComponentFilePath($componentName, 'index.twig'); |
@@ -21,9 +21,9 @@ discard block |
||
21 | 21 | return $output; |
22 | 22 | } |
23 | 23 | |
24 | - $addArea = function ($twig) use ($areaHtml) { |
|
24 | + $addArea = function($twig) use ($areaHtml) { |
|
25 | 25 | |
26 | - $twig->addFunction(new Twig_SimpleFunction('area', function ($areaName) use ($areaHtml) { |
|
26 | + $twig->addFunction(new Twig_SimpleFunction('area', function($areaName) use ($areaHtml) { |
|
27 | 27 | if (array_key_exists($areaName, $areaHtml)) { |
28 | 28 | return $areaHtml[$areaName]; |
29 | 29 | } |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | |
35 | 35 | add_filter('get_twig', $addArea); |
36 | 36 | |
37 | - $returnTimberPaths = function ($paths) use ($filePath) { |
|
37 | + $returnTimberPaths = function($paths) use ($filePath) { |
|
38 | 38 | array_unshift($paths, dirname($filePath)); |
39 | 39 | return $paths; |
40 | 40 | }; |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | }, 10, 4); |
52 | 52 | |
53 | 53 | // Convert ACF Images to Timber Images |
54 | -add_filter('acf/format_value/type=image', function ($value) { |
|
54 | +add_filter('acf/format_value/type=image', function($value) { |
|
55 | 55 | if (!empty($value)) { |
56 | 56 | $value = new Image($value); |
57 | 57 | } |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | }, 100); |
60 | 60 | |
61 | 61 | // Convert ACF Field of type post_object to a Timber\Post and add all ACF Fields of that Post |
62 | -add_filter('acf/format_value/type=post_object', function ($value) { |
|
62 | +add_filter('acf/format_value/type=post_object', function($value) { |
|
63 | 63 | if (is_array($value)) { |
64 | 64 | $value = array_map(NS . 'convertToTimberPost', $value); |
65 | 65 | } else { |
@@ -26,7 +26,7 @@ |
||
26 | 26 | self::setupHelpers(); |
27 | 27 | |
28 | 28 | // add styles for admin area |
29 | - add_action('admin_enqueue_scripts', function () { |
|
29 | + add_action('admin_enqueue_scripts', function() { |
|
30 | 30 | Asset::enqueue([ |
31 | 31 | 'type' => 'style', |
32 | 32 | 'name' => 'Flynt/Features/Acf/AdminCss', |
@@ -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 .= '<a class="acf-icon small -collapse collapse-all" title="collapse all"></a>'; |
@@ -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::getOption('globalOptions', 'feature', 'Acf', 'googleMapsApiKey'); |
11 | 11 | if ($apiKey) { |
12 | 12 | $api['key'] = $apiKey; |
@@ -9,7 +9,7 @@ |
||
9 | 9 | use Flynt\Features\CustomPostTypes\CustomPostTypeRegister; |
10 | 10 | |
11 | 11 | // NOTE: this needs to happen on init to allow taxonomies to register |
12 | -add_action('init', function () { |
|
12 | +add_action('init', function() { |
|
13 | 13 | $featureOptions = Feature::getOption('flynt-custom-post-types', 0); |
14 | 14 | $dir = isset($featureOptions['dir']) ? $featureOptions['dir'] : null; |
15 | 15 | $fileName = isset($featureOptions['fileName']) ? $featureOptions['fileName'] : null; |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | |
52 | 52 | protected static function cleanConfig($config) |
53 | 53 | { |
54 | - $cleanConfig = array_map(function ($value) { |
|
54 | + $cleanConfig = array_map(function($value) { |
|
55 | 55 | if (is_array($value)) { |
56 | 56 | return self::cleanConfig($value); |
57 | 57 | } |
@@ -60,14 +60,14 @@ discard block |
||
60 | 60 | }, $config); |
61 | 61 | |
62 | 62 | // remove null values or empty arrays |
63 | - return array_filter($cleanConfig, function ($value) { |
|
63 | + return array_filter($cleanConfig, function($value) { |
|
64 | 64 | return !(is_null($value) || (is_array($value) && empty($value))); |
65 | 65 | }); |
66 | 66 | } |
67 | 67 | |
68 | 68 | protected static function getConfigs($dir) |
69 | 69 | { |
70 | - $configs = FileLoader::iterateDir($dir, function ($file) { |
|
70 | + $configs = FileLoader::iterateDir($dir, function($file) { |
|
71 | 71 | if ($file->isDir()) { |
72 | 72 | $configPath = $file->getPathname() . '/' . self::$fileName; |
73 | 73 |
@@ -2,7 +2,7 @@ |
||
2 | 2 | |
3 | 3 | namespace Flynt\Features\MimeTypes; |
4 | 4 | |
5 | -add_filter('upload_mimes', function ($mimes) { |
|
5 | +add_filter('upload_mimes', function($mimes) { |
|
6 | 6 | $mimes['svg'] = 'image/svg+xml'; |
7 | 7 | return $mimes; |
8 | 8 | }); |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | * clone |
29 | 29 | * |
30 | 30 | * Prevent cloning with 'protected' keyword |
31 | - **/ |
|
31 | + **/ |
|
32 | 32 | protected function __clone() |
33 | 33 | { |
34 | 34 | } |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | * constructor |
38 | 38 | * |
39 | 39 | * Prevent instantiation with 'protected' keyword |
40 | - **/ |
|
40 | + **/ |
|
41 | 41 | protected function __construct() |
42 | 42 | { |
43 | 43 | } |
@@ -68,7 +68,7 @@ |
||
68 | 68 | . "<p><strong>{$options['title']}</strong></p>" |
69 | 69 | . $msg . '</div>'; |
70 | 70 | |
71 | - add_action('admin_notices', function () use ($msg) { |
|
71 | + add_action('admin_notices', function() use ($msg) { |
|
72 | 72 | echo $msg; |
73 | 73 | }); |
74 | 74 |
@@ -3,6 +3,6 @@ |
||
3 | 3 | namespace Flynt\Features\Templates; |
4 | 4 | |
5 | 5 | // Set Config Path |
6 | -add_filter('Flynt/configPath', function ($filePath, $fileName) { |
|
6 | +add_filter('Flynt/configPath', function($filePath, $fileName) { |
|
7 | 7 | return get_template_directory() . '/config/templates/' . $fileName; |
8 | 8 | }, 10, 2); |