@@ -7,29 +7,29 @@ |
||
7 | 7 | add_action('wp_enqueue_scripts', function () { |
8 | 8 | Component::enqueueAssets('DocumentDefault', [ |
9 | 9 | [ |
10 | - 'name' => 'console-polyfill', |
|
11 | - 'type' => 'script', |
|
12 | - 'path' => 'vendor/console.js' |
|
10 | + 'name' => 'console-polyfill', |
|
11 | + 'type' => 'script', |
|
12 | + 'path' => 'vendor/console.js' |
|
13 | 13 | ], |
14 | 14 | [ |
15 | - 'name' => 'babel-polyfill', |
|
16 | - 'type' => 'script', |
|
17 | - 'path' => 'vendor/babel-polyfill.js' |
|
15 | + 'name' => 'babel-polyfill', |
|
16 | + 'type' => 'script', |
|
17 | + 'path' => 'vendor/babel-polyfill.js' |
|
18 | 18 | ], |
19 | 19 | [ |
20 | - 'name' => 'document-register-element', |
|
21 | - 'type' => 'script', |
|
22 | - 'path' => 'vendor/document-register-element.js' |
|
20 | + 'name' => 'document-register-element', |
|
21 | + 'type' => 'script', |
|
22 | + 'path' => 'vendor/document-register-element.js' |
|
23 | 23 | ], |
24 | 24 | [ |
25 | - 'name' => 'picturefill', |
|
26 | - 'path' => 'vendor/picturefill.js', |
|
27 | - 'type' => 'script' |
|
25 | + 'name' => 'picturefill', |
|
26 | + 'path' => 'vendor/picturefill.js', |
|
27 | + 'type' => 'script' |
|
28 | 28 | ], |
29 | 29 | [ |
30 | - 'name' => 'normalize', |
|
31 | - 'path' => 'vendor/normalize.css', |
|
32 | - 'type' => 'style' |
|
30 | + 'name' => 'normalize', |
|
31 | + 'path' => 'vendor/normalize.css', |
|
32 | + 'type' => 'style' |
|
33 | 33 | ] |
34 | 34 | ]); |
35 | 35 | }, 0); |
@@ -4,7 +4,7 @@ discard block |
||
4 | 4 | use Timber\Timber; |
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('DocumentDefault', [ |
9 | 9 | [ |
10 | 10 | 'name' => 'console-polyfill', |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | ]); |
35 | 35 | }, 0); |
36 | 36 | |
37 | -add_filter('Flynt/addComponentData?name=DocumentDefault', function ($data) { |
|
37 | +add_filter('Flynt/addComponentData?name=DocumentDefault', function($data) { |
|
38 | 38 | $context = Timber::get_context(); |
39 | 39 | |
40 | 40 | $output = array( |
@@ -5,15 +5,15 @@ |
||
5 | 5 | use Timber\Timber; |
6 | 6 | use Flynt\Features\Components\Component; |
7 | 7 | |
8 | -add_action('wp_enqueue_scripts', function () { |
|
8 | +add_action('wp_enqueue_scripts', function() { |
|
9 | 9 | Component::enqueueAssets('LayoutMultiplePosts'); |
10 | 10 | }); |
11 | 11 | |
12 | -add_filter('Flynt/addComponentData?name=LayoutMultiplePosts', function ($data) { |
|
12 | +add_filter('Flynt/addComponentData?name=LayoutMultiplePosts', function($data) { |
|
13 | 13 | $query = !empty($data['query']) ? $data['query'] : false; |
14 | 14 | $posts = Timber::get_posts($query); |
15 | 15 | if (!empty($posts)) { |
16 | - $posts = array_map(function ($post) { |
|
16 | + $posts = array_map(function($post) { |
|
17 | 17 | $fields = get_fields($post->id); |
18 | 18 | $post->fields = $fields === false ? [] : $fields; |
19 | 19 | return $post; |
@@ -4,7 +4,7 @@ discard block |
||
4 | 4 | |
5 | 5 | use Flynt\Features\Acf\OptionPages; |
6 | 6 | |
7 | -add_filter('Flynt/addComponentData?name=ComponentLoaderStatic', function ($data, $parentData) { |
|
7 | +add_filter('Flynt/addComponentData?name=ComponentLoaderStatic', function($data, $parentData) { |
|
8 | 8 | $optionPage = (array_key_exists('optionPage', $data)) ? $data['optionPage'] : []; |
9 | 9 | if (is_array($optionPage) && |
10 | 10 | array_key_exists('optionType', $optionPage) && |
@@ -23,9 +23,9 @@ discard block |
||
23 | 23 | return $data; |
24 | 24 | }, 10, 2); |
25 | 25 | |
26 | -add_filter('Flynt/dynamicSubcomponents?name=ComponentLoaderStatic', function ($areas, $data, $parentData) { |
|
26 | +add_filter('Flynt/dynamicSubcomponents?name=ComponentLoaderStatic', function($areas, $data, $parentData) { |
|
27 | 27 | if (!empty($areas['components'])) { |
28 | - $areas['components'] = array_map(function ($component) use ($data, $parentData) { |
|
28 | + $areas['components'] = array_map(function($component) use ($data, $parentData) { |
|
29 | 29 | if (isset($component['customData']) && isset($component['customData']['filterArgument'])) { |
30 | 30 | $filterArgument = $component['customData']['filterArgument'] . '_'; |
31 | 31 | $componentData = []; |
@@ -4,7 +4,7 @@ discard block |
||
4 | 4 | |
5 | 5 | use Flynt\Features\Acf\OptionPages; |
6 | 6 | |
7 | -add_filter('Flynt/addComponentData?name=ComponentLoaderFlexible', function ($data) { |
|
7 | +add_filter('Flynt/addComponentData?name=ComponentLoaderFlexible', function($data) { |
|
8 | 8 | $optionPage = (array_key_exists('optionPage', $data)) ? $data['optionPage'] : []; |
9 | 9 | if (is_array($optionPage) && |
10 | 10 | array_key_exists('optionType', $optionPage) && |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | return $data; |
22 | 22 | }); |
23 | 23 | |
24 | -add_filter('Flynt/dynamicSubcomponents?name=ComponentLoaderFlexible', function ($areas, $data, $parentData) { |
|
24 | +add_filter('Flynt/dynamicSubcomponents?name=ComponentLoaderFlexible', function($areas, $data, $parentData) { |
|
25 | 25 | $fieldGroup = $data['fieldGroup']; |
26 | 26 | if (array_key_exists($fieldGroup, $data) && |
27 | 27 | $data[$fieldGroup] !== false |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | $fieldGroupData = $parentData['post']->fields[$fieldGroup]; |
34 | 34 | } |
35 | 35 | if (isset($fieldGroupData)) { |
36 | - $areas['components'] = array_map(function ($field) use ($parentData) { |
|
36 | + $areas['components'] = array_map(function($field) use ($parentData) { |
|
37 | 37 | return [ |
38 | 38 | 'name' => ucfirst($field['acf_fc_layout']), |
39 | 39 | 'customData' => $field, |
@@ -84,7 +84,7 @@ |
||
84 | 84 | } |
85 | 85 | |
86 | 86 | // Filter out other (non-flynt) theme features |
87 | - $flyntThemeFeatures = array_filter($GLOBALS['_wp_theme_features'], function ($feature) { |
|
87 | + $flyntThemeFeatures = array_filter($GLOBALS['_wp_theme_features'], function($feature) { |
|
88 | 88 | return StringHelpers::startsWith('flynt-', $feature); |
89 | 89 | }, ARRAY_FILTER_USE_KEY); |
90 | 90 |
@@ -16,7 +16,7 @@ |
||
16 | 16 | |
17 | 17 | public static function consoleDebug($data, $title = 'PHP', $logType = 'log') |
18 | 18 | { |
19 | - $title .= '(' . self::getCallerFile(2) .'):'; |
|
19 | + $title .= '(' . self::getCallerFile(2) . '):'; |
|
20 | 20 | $type = gettype($data); |
21 | 21 | if (is_array($data) || is_object($data)) { |
22 | 22 | $output = json_encode($data); |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | if (count($files) === 0) { |
45 | 45 | $dir = get_template_directory() . '/' . $dir; |
46 | 46 | |
47 | - self::iterateDir($dir, function ($file) { |
|
47 | + self::iterateDir($dir, function($file) { |
|
48 | 48 | if ($file->isDir()) { |
49 | 49 | $dirPath = trim(str_replace(get_template_directory(), '', $file->getPathname()), '/'); |
50 | 50 | self::loadPhpFiles($dirPath); |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | } |
55 | 55 | }); |
56 | 56 | } else { |
57 | - array_walk($files, function ($file) use ($dir) { |
|
57 | + array_walk($files, function($file) use ($dir) { |
|
58 | 58 | $filePath = $dir . '/' . ltrim($file, '/'); |
59 | 59 | |
60 | 60 | if (!locate_template($filePath, true, true)) { |
@@ -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 |
@@ -51,7 +51,7 @@ |
||
51 | 51 | if (is_array($value)) { |
52 | 52 | // Loop through array and apply translations while keeping keys intact |
53 | 53 | // NOTE: assuming it's a single dimensional array |
54 | - return array_reduce(array_keys($value), function ($carry, $key) use ($value) { |
|
54 | + return array_reduce(array_keys($value), function($carry, $key) use ($value) { |
|
55 | 55 | return array_merge($carry, [ |
56 | 56 | $key => _x($value[$key], $key, 'flynt-starter-theme') |
57 | 57 | ]); |