@@ -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)) { |
@@ -22,10 +22,10 @@ discard block |
||
22 | 22 | public static function consoleDebug($data, $postpone = true, $title = 'PHP', $logType = 'log') |
23 | 23 | { |
24 | 24 | if (in_array($logType, ['log', 'error', 'trace'])) { |
25 | - $title .= '(' . self::getCallerFile(2) .'):'; |
|
25 | + $title .= '(' . self::getCallerFile(2) . '):'; |
|
26 | 26 | $type = gettype($data); |
27 | 27 | $output = json_encode($data); |
28 | - $result = "<script>console.{$logType}('{$title}', '({$type})', {$output});</script>\n"; |
|
28 | + $result = "<script>console.{$logType}('{$title}', '({$type})', {$output});</script>\n"; |
|
29 | 29 | self::echoDebug($result, $postpone); |
30 | 30 | } |
31 | 31 | } |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | protected static function echoDebug($data, $postpone) |
47 | 47 | { |
48 | 48 | if ($postpone) { |
49 | - add_action('wp_footer', function () use ($data) { |
|
49 | + add_action('wp_footer', function() use ($data) { |
|
50 | 50 | echo $data; |
51 | 51 | }, 30); |
52 | 52 | } else { |
@@ -34,11 +34,11 @@ |
||
34 | 34 | */ |
35 | 35 | public static function indexedValuesToAssocKeys(array $array) |
36 | 36 | { |
37 | - $values = array_map(function ($value) { |
|
37 | + $values = array_map(function($value) { |
|
38 | 38 | return is_array($value) ? $value : []; |
39 | 39 | }, $array); |
40 | 40 | |
41 | - $keys = array_map(function ($key) use ($array) { |
|
41 | + $keys = array_map(function($key) use ($array) { |
|
42 | 42 | return is_int($key) ? $array[$key] : $key; |
43 | 43 | }, array_keys($array)); |
44 | 44 |
@@ -6,7 +6,7 @@ discard block |
||
6 | 6 | { |
7 | 7 | public static function setTemplateDirectory() |
8 | 8 | { |
9 | - add_action('after_switch_theme', function () { |
|
9 | + add_action('after_switch_theme', function() { |
|
10 | 10 | $stylesheet = get_option('stylesheet'); |
11 | 11 | |
12 | 12 | if (basename($stylesheet) !== 'templates') { |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | } |
15 | 15 | }); |
16 | 16 | |
17 | - add_filter('stylesheet', function ($stylesheet) { |
|
17 | + add_filter('stylesheet', function($stylesheet) { |
|
18 | 18 | return dirname($stylesheet); |
19 | 19 | }); |
20 | 20 | } |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | } |
34 | 34 | |
35 | 35 | if (!$acfActive || !$flyntCoreActive) { |
36 | - add_filter('template_include', function () { |
|
36 | + add_filter('template_include', function() { |
|
37 | 37 | $newTemplate = locate_template('plugin-inactive.php'); |
38 | 38 | if ('' != $newTemplate) { |
39 | 39 | return $newTemplate; |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | |
54 | 54 | protected static function notifyRequiredPluginIsMissing($pluginName) |
55 | 55 | { |
56 | - add_action('admin_notices', function () use ($pluginName) { |
|
56 | + add_action('admin_notices', function() use ($pluginName) { |
|
57 | 57 | echo "<div class=\"error\"><p>${pluginName} Plugin not activated. Make sure you activate the plugin on the <a href=\"" |
58 | 58 | . esc_url(admin_url('plugins.php')) . "\">plugin page</a>.</p></div>"; |
59 | 59 | }); |
@@ -2,7 +2,7 @@ |
||
2 | 2 | |
3 | 3 | use ACFComposer\ACFComposer; |
4 | 4 | |
5 | -add_action('acf/init', function () { |
|
5 | +add_action('acf/init', function() { |
|
6 | 6 | ACFComposer::registerFieldGroup([ |
7 | 7 | 'name' => 'pageComponents', |
8 | 8 | 'title' => 'Page Components', |
@@ -2,7 +2,7 @@ |
||
2 | 2 | |
3 | 3 | use ACFComposer\ACFComposer; |
4 | 4 | |
5 | -add_action('acf/init', function () { |
|
5 | +add_action('acf/init', function() { |
|
6 | 6 | ACFComposer::registerFieldGroup([ |
7 | 7 | 'name' => 'postComponents', |
8 | 8 | 'title' => 'Post Components', |
@@ -4,11 +4,11 @@ discard block |
||
4 | 4 | use Flynt\Utils\Asset; |
5 | 5 | use function Flynt\Features\TimberLoader\renderTwigIndex; |
6 | 6 | |
7 | -add_filter('get_twig', function ($twig) { |
|
7 | +add_filter('get_twig', function($twig) { |
|
8 | 8 | $twig->addFunction(new Twig_SimpleFunction('renderComponent', 'renderComponent')); |
9 | 9 | |
10 | - $twig->addFunction(new Twig_SimpleFunction('renderFlexibleContent', function ($fcField) { |
|
11 | - return implode('', array_map(function ($field) { |
|
10 | + $twig->addFunction(new Twig_SimpleFunction('renderFlexibleContent', function($fcField) { |
|
11 | + return implode('', array_map(function($field) { |
|
12 | 12 | return renderComponent(ucfirst($field['acf_fc_layout']), $field); |
13 | 13 | }, $fcField)); |
14 | 14 | })); |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | return $twig; |
17 | 17 | }); |
18 | 18 | |
19 | -function renderComponent ($name, $data = []) |
|
19 | +function renderComponent($name, $data = []) |
|
20 | 20 | { |
21 | 21 | $data = apply_filters( |
22 | 22 | 'Flynt/addComponentData', |
@@ -38,11 +38,11 @@ discard block |
||
38 | 38 | return renderTwigIndex(null, $name, $data, null); |
39 | 39 | }; |
40 | 40 | |
41 | -add_action('after_setup_theme', function () { |
|
41 | +add_action('after_setup_theme', function() { |
|
42 | 42 | new Timber\Timber(); |
43 | 43 | }); |
44 | 44 | |
45 | -add_action('wp_enqueue_scripts', function () { |
|
45 | +add_action('wp_enqueue_scripts', function() { |
|
46 | 46 | Asset::register([ |
47 | 47 | 'name' => 'console-polyfill', |
48 | 48 | 'type' => 'script', |