@@ -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 |
@@ -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'); |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | |
73 | 73 | public static function registerHooks() |
74 | 74 | { |
75 | - add_filter('Flynt/renderComponent', function ($output, $componentName, $data) { |
|
75 | + add_filter('Flynt/renderComponent', function($output, $componentName, $data) { |
|
76 | 76 | return apply_filters( |
77 | 77 | "Flynt/renderComponent?name={$componentName}", |
78 | 78 | $output, |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | ); |
82 | 82 | }, 10, 3); |
83 | 83 | |
84 | - add_filter('Flynt/addComponentData', function ($data, $componentName) { |
|
84 | + add_filter('Flynt/addComponentData', function($data, $componentName) { |
|
85 | 85 | return apply_filters( |
86 | 86 | "Flynt/addComponentData?name={$componentName}", |
87 | 87 | $data, |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | namespace Flynt\TinyMce; |
10 | 10 | |
11 | 11 | // First Toolbar |
12 | -add_filter('mce_buttons', function ($buttons) { |
|
12 | +add_filter('mce_buttons', function($buttons) { |
|
13 | 13 | $config = getConfig(); |
14 | 14 | if ($config && isset($config['toolbars'])) { |
15 | 15 | $toolbars = $config['toolbars']; |
@@ -21,11 +21,11 @@ discard block |
||
21 | 21 | }); |
22 | 22 | |
23 | 23 | // Second Toolbar |
24 | -add_filter('mce_buttons_2', function ($buttons) { |
|
24 | +add_filter('mce_buttons_2', function($buttons) { |
|
25 | 25 | return []; |
26 | 26 | }); |
27 | 27 | |
28 | -add_filter('tiny_mce_before_init', function ($init) { |
|
28 | +add_filter('tiny_mce_before_init', function($init) { |
|
29 | 29 | $config = getConfig(); |
30 | 30 | if ($config) { |
31 | 31 | if (isset($config['blockformats'])) { |
@@ -40,11 +40,11 @@ discard block |
||
40 | 40 | return $init; |
41 | 41 | }); |
42 | 42 | |
43 | -add_filter('acf/fields/wysiwyg/toolbars', function ($toolbars) { |
|
43 | +add_filter('acf/fields/wysiwyg/toolbars', function($toolbars) { |
|
44 | 44 | // Load Toolbars and parse them into TinyMCE |
45 | 45 | $config = getConfig(); |
46 | 46 | if ($config && !empty($config['toolbars'])) { |
47 | - $toolbars = array_map(function ($toolbar) { |
|
47 | + $toolbars = array_map(function($toolbar) { |
|
48 | 48 | array_unshift($toolbar, []); |
49 | 49 | return $toolbar; |
50 | 50 | }, $config['toolbars']); |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | { |
57 | 57 | if (!empty($blockFormats)) { |
58 | 58 | $blockFormatStrings = array_map( |
59 | - function ($tag, $label) { |
|
59 | + function($tag, $label) { |
|
60 | 60 | return "${label}=${tag}"; |
61 | 61 | }, |
62 | 62 | $blockFormats, |
@@ -4,7 +4,7 @@ |
||
4 | 4 | |
5 | 5 | use Flynt\Utils\TwigReadingTimeExtension; |
6 | 6 | |
7 | -add_filter('get_twig', function ($twig) { |
|
7 | +add_filter('get_twig', function($twig) { |
|
8 | 8 | $twig->addExtension(new TwigReadingTimeExtension()); |
9 | 9 | return $twig; |
10 | 10 | }); |