@@ -8,7 +8,7 @@ |
||
8 | 8 | |
9 | 9 | use Flynt\Utils\Asset; |
10 | 10 | |
11 | -add_action('wp_enqueue_scripts', function () { |
|
11 | +add_action('wp_enqueue_scripts', function() { |
|
12 | 12 | $jqueryVersion = wp_scripts()->registered['jquery']->ver; |
13 | 13 | wp_deregister_script('jquery'); |
14 | 14 |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | |
11 | 11 | define(__NAMESPACE__ . '\NS', __NAMESPACE__ . '\\'); |
12 | 12 | |
13 | -add_action('Flynt/afterRegisterComponents', function () { |
|
13 | +add_action('Flynt/afterRegisterComponents', function() { |
|
14 | 14 | if ((WP_ENV === 'development' || current_user_can('editor') || current_user_can('administrator')) && isset($_GET['log'])) { |
15 | 15 | if (isset($_GET['component']) && !empty($_GET['component'])) { |
16 | 16 | define(__NAMESPACE__ . '\COMPONENT_WHITELIST', explode(',', $_GET['component'])); |
@@ -36,21 +36,21 @@ discard block |
||
36 | 36 | { |
37 | 37 | $type = gettype($data); |
38 | 38 | $output = json_encode($data); |
39 | - $result = "<script>console.log({$output});</script>\n"; |
|
39 | + $result = "<script>console.log({$output});</script>\n"; |
|
40 | 40 | echoDebug($result, $postpone); |
41 | 41 | } |
42 | 42 | |
43 | 43 | function consoleTable($data, $postpone = true) |
44 | 44 | { |
45 | 45 | $output = json_encode($data); |
46 | - $result = "<script>console.table({$output});</script>\n"; |
|
46 | + $result = "<script>console.table({$output});</script>\n"; |
|
47 | 47 | echoDebug($result, $postpone); |
48 | 48 | } |
49 | 49 | |
50 | 50 | function echoDebug($data, $postpone) |
51 | 51 | { |
52 | 52 | if ($postpone) { |
53 | - add_action('wp_footer', function () use ($data) { |
|
53 | + add_action('wp_footer', function() use ($data) { |
|
54 | 54 | echo $data; |
55 | 55 | }, 30); |
56 | 56 | } else { |
@@ -17,7 +17,7 @@ |
||
17 | 17 | * |
18 | 18 | * Don't return the default description in the RSS feed if it hasn't been changed |
19 | 19 | */ |
20 | -add_filter('get_bloginfo_rss', function ($bloginfo) { |
|
20 | +add_filter('get_bloginfo_rss', function($bloginfo) { |
|
21 | 21 | $defaultTagline = 'Just another WordPress site'; |
22 | 22 | return ($bloginfo === $defaultTagline) ? '' : $bloginfo; |
23 | 23 | }); |
@@ -28,11 +28,11 @@ discard block |
||
28 | 28 | * Remove self-closing tag |
29 | 29 | * |
30 | 30 | */ |
31 | -add_action('init', function () { |
|
31 | +add_action('init', function() { |
|
32 | 32 | // Originally from http://wpengineer.com/1438/wordpress-header/ |
33 | 33 | remove_action('wp_head', 'feed_links_extra', 3); |
34 | 34 | add_action('wp_head', 'ob_start', 1, 0); |
35 | - add_action('wp_head', function () { |
|
35 | + add_action('wp_head', function() { |
|
36 | 36 | $pattern = '/.*' . preg_quote(esc_url(get_feed_link('comments_' . get_default_feed())), '/') . '.*[\r\n]+/'; |
37 | 37 | echo preg_replace($pattern, '', ob_get_clean()); |
38 | 38 | }, 3, 0); |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | * |
61 | 61 | * Clean up output of stylesheet <link> tags |
62 | 62 | */ |
63 | -add_filter('style_loader_tag', function ($input) { |
|
63 | +add_filter('style_loader_tag', function($input) { |
|
64 | 64 | preg_match_all( |
65 | 65 | "!<link rel='stylesheet'\s?(id='[^']+')?\s+href='(.*)' type='text/css' media='(.*)' />!", |
66 | 66 | $input, |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | if (count($files) === 0) { |
58 | 58 | $dir = get_template_directory() . '/' . $dir; |
59 | 59 | |
60 | - self::iterateDir($dir, function ($file) { |
|
60 | + self::iterateDir($dir, function($file) { |
|
61 | 61 | if ($file->isDir()) { |
62 | 62 | $dirPath = trim(str_replace(get_template_directory(), '', $file->getPathname()), '/'); |
63 | 63 | self::loadPhpFiles($dirPath); |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | } |
68 | 68 | }); |
69 | 69 | } else { |
70 | - array_walk($files, function ($file) use ($dir) { |
|
70 | + array_walk($files, function($file) use ($dir) { |
|
71 | 71 | $filePath = $dir . '/' . ltrim($file, '/'); |
72 | 72 | |
73 | 73 | if (!locate_template($filePath, true, true)) { |
@@ -85,7 +85,7 @@ |
||
85 | 85 | . "<p><strong>{$options['title']}</strong></p>" |
86 | 86 | . $msg . '</div>'; |
87 | 87 | |
88 | - add_action('admin_notices', function () use ($msg) { |
|
88 | + add_action('admin_notices', function() use ($msg) { |
|
89 | 89 | echo $msg; |
90 | 90 | }); |
91 | 91 |
@@ -149,10 +149,10 @@ |
||
149 | 149 | } |
150 | 150 | if ($type === 'style') { |
151 | 151 | global $wp_styles; |
152 | - $repo =& $wp_styles; |
|
152 | + $repo = & $wp_styles; |
|
153 | 153 | } else { |
154 | 154 | global $wp_scripts; |
155 | - $repo =& $wp_scripts; |
|
155 | + $repo = & $wp_scripts; |
|
156 | 156 | } |
157 | 157 | |
158 | 158 | $asset = $repo->query($handle, 'registered'); |
@@ -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 |
@@ -25,7 +25,7 @@ |
||
25 | 25 | return $output; |
26 | 26 | } |
27 | 27 | |
28 | - // this action needs to be removed by the user if they want to overwrite this functionality |
|
28 | + // this action needs to be removed by the user if they want to overwrite this functionality |
|
29 | 29 | public static function loadFunctionsFile($componentName) |
30 | 30 | { |
31 | 31 | $componentManager = ComponentManager::getInstance(); |
@@ -39,7 +39,7 @@ |
||
39 | 39 | return ''; |
40 | 40 | } |
41 | 41 | |
42 | - $data = function () use ($componentData) { |
|
42 | + $data = function() use ($componentData) { |
|
43 | 43 | $args = func_get_args(); |
44 | 44 | array_unshift($args, $componentData); |
45 | 45 | return Helpers::extractNestedDataFromArray($args); |