@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | } |
17 | 17 | |
18 | 18 | // collect script dependencies |
19 | - $scriptDeps = array_reduce($dependencies, function ($list, $dependency) { |
|
19 | + $scriptDeps = array_reduce($dependencies, function($list, $dependency) { |
|
20 | 20 | if ($dependency['type'] === 'script') { |
21 | 21 | array_push($list, $dependency['name']); |
22 | 22 | } |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | } |
36 | 36 | |
37 | 37 | // collect style dependencies |
38 | - $styleDeps = array_reduce($dependencies, function ($list, $dependency) { |
|
38 | + $styleDeps = array_reduce($dependencies, function($list, $dependency) { |
|
39 | 39 | if ($dependency['type'] === 'style') { |
40 | 40 | array_push($list, $dependency['name']); |
41 | 41 | } |
@@ -2,7 +2,7 @@ |
||
2 | 2 | |
3 | 3 | namespace Flynt\Features\RemoveEditor; |
4 | 4 | |
5 | -add_action('init', function () { |
|
5 | +add_action('init', function() { |
|
6 | 6 | remove_post_type_support('page', 'editor'); |
7 | 7 | remove_post_type_support('post', 'editor'); |
8 | 8 | }); |
@@ -2,7 +2,7 @@ |
||
2 | 2 | |
3 | 3 | namespace Flynt\Features\Navigation; |
4 | 4 | |
5 | -add_action('init', function () { |
|
5 | +add_action('init', function() { |
|
6 | 6 | register_nav_menus([ |
7 | 7 | 'navigation_main' => __('Navigation Main', 'flynt-starter-theme'), |
8 | 8 | 'navigation_footer' => __('Navigation Footer', 'flynt-starter-theme') |
@@ -12,7 +12,7 @@ |
||
12 | 12 | * |
13 | 13 | * Don't return the default description in the RSS feed if it hasn't been changed |
14 | 14 | */ |
15 | -add_filter('get_bloginfo_rss', function ($bloginfo) { |
|
15 | +add_filter('get_bloginfo_rss', function($bloginfo) { |
|
16 | 16 | $defaultTagline = 'Just another WordPress site'; |
17 | 17 | return ($bloginfo === $defaultTagline) ? '' : $bloginfo; |
18 | 18 | }); |
@@ -12,11 +12,11 @@ discard block |
||
12 | 12 | * Remove self-closing tag |
13 | 13 | * |
14 | 14 | */ |
15 | -add_action('init', function () { |
|
15 | +add_action('init', function() { |
|
16 | 16 | // Originally from http://wpengineer.com/1438/wordpress-header/ |
17 | 17 | remove_action('wp_head', 'feed_links_extra', 3); |
18 | 18 | add_action('wp_head', 'ob_start', 1, 0); |
19 | - add_action('wp_head', function () { |
|
19 | + add_action('wp_head', function() { |
|
20 | 20 | $pattern = '/.*' . preg_quote(esc_url(get_feed_link('comments_' . get_default_feed())), '/') . '.*[\r\n]+/'; |
21 | 21 | echo preg_replace($pattern, '', ob_get_clean()); |
22 | 22 | }, 3, 0); |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | * |
45 | 45 | * Clean up output of stylesheet <link> tags |
46 | 46 | */ |
47 | -add_filter('style_loader_tag', function ($input) { |
|
47 | +add_filter('style_loader_tag', function($input) { |
|
48 | 48 | preg_match_all( |
49 | 49 | "!<link rel='stylesheet'\s?(id='[^']+')?\s+href='(.*)' type='text/css' media='(.*)' />!", |
50 | 50 | $input, |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | * |
64 | 64 | * Clean up output of <script> tags |
65 | 65 | */ |
66 | -add_filter('script_loader_tag', function ($input) { |
|
66 | +add_filter('script_loader_tag', function($input) { |
|
67 | 67 | $input = str_replace("type='text/javascript' ", '', $input); |
68 | 68 | return str_replace("'", '"', $input); |
69 | 69 | }); |
@@ -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 |
@@ -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)) { |