@@ -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, |
@@ -5,7 +5,7 @@ |
||
5 | 5 | */ |
6 | 6 | namespace Flynt\HideProtectedPosts; |
7 | 7 | |
8 | -add_action('pre_get_posts', function ($query) { |
|
8 | +add_action('pre_get_posts', function($query) { |
|
9 | 9 | if (!$query->is_singular() && !is_admin()) { |
10 | 10 | $query->set('has_password', false); |
11 | 11 | } |
@@ -68,7 +68,7 @@ |
||
68 | 68 | . "<p><strong>{$options['title']}</strong></p>" |
69 | 69 | . $msg . '</div>'; |
70 | 70 | |
71 | - add_action('admin_notices', function () use ($msg) { |
|
71 | + add_action('admin_notices', function() use ($msg) { |
|
72 | 72 | echo $msg; |
73 | 73 | }); |
74 | 74 |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | |
80 | 80 | public static function registerHooks() |
81 | 81 | { |
82 | - add_filter('Flynt/renderComponent', function ($output, $componentName, $data) { |
|
82 | + add_filter('Flynt/renderComponent', function($output, $componentName, $data) { |
|
83 | 83 | return apply_filters( |
84 | 84 | "Flynt/renderComponent?name={$componentName}", |
85 | 85 | $output, |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | ); |
89 | 89 | }, 10, 3); |
90 | 90 | |
91 | - add_filter('Flynt/addComponentData', function ($data, $componentName) { |
|
91 | + add_filter('Flynt/addComponentData', function($data, $componentName) { |
|
92 | 92 | return apply_filters( |
93 | 93 | "Flynt/addComponentData?name={$componentName}", |
94 | 94 | $data, |
@@ -3,7 +3,7 @@ discard block |
||
3 | 3 | |
4 | 4 | use Flynt\Utils\Asset; |
5 | 5 | |
6 | -add_action('admin_enqueue_scripts', function () { |
|
6 | +add_action('admin_enqueue_scripts', function() { |
|
7 | 7 | $data = [ |
8 | 8 | 'templateDirectoryUri' => get_template_directory_uri() . '/dist', |
9 | 9 | ]; |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | if (class_exists('acf')) { |
14 | 14 | if (is_admin()) { |
15 | 15 | // add image to the flexible content component name |
16 | - add_filter('acf/fields/flexible_content/layout_title', function ($title, $field, $layout, $i) { |
|
16 | + add_filter('acf/fields/flexible_content/layout_title', function($title, $field, $layout, $i) { |
|
17 | 17 | $componentName = ucfirst($layout['name']); |
18 | 18 | $componentPath = "Components/{$componentName}"; |
19 | 19 | $componentScreenshotPath = Asset::requirePath("{$componentPath}/screenshot.png"); |
@@ -5,7 +5,7 @@ |
||
5 | 5 | use Timber\Timber; |
6 | 6 | use Timber\Post; |
7 | 7 | |
8 | -add_filter('the_password_form', function ($output) { |
|
8 | +add_filter('the_password_form', function($output) { |
|
9 | 9 | $context = Timber::get_context(); |
10 | 10 | $context['form'] = [ |
11 | 11 | 'url' => site_url('/wp-login.php?action=postpass', 'login_post') |
@@ -7,7 +7,7 @@ discard block |
||
7 | 7 | // Load TinyMCE Settings from config file |
8 | 8 | |
9 | 9 | // First Toolbar |
10 | -add_filter('mce_buttons', function ($buttons) { |
|
10 | +add_filter('mce_buttons', function($buttons) { |
|
11 | 11 | $config = getConfig(); |
12 | 12 | if ($config && isset($config['toolbars'])) { |
13 | 13 | $toolbars = $config['toolbars']; |
@@ -19,11 +19,11 @@ discard block |
||
19 | 19 | }); |
20 | 20 | |
21 | 21 | // Second Toolbar |
22 | -add_filter('mce_buttons_2', function ($buttons) { |
|
22 | +add_filter('mce_buttons_2', function($buttons) { |
|
23 | 23 | return []; |
24 | 24 | }); |
25 | 25 | |
26 | -add_filter('tiny_mce_before_init', function ($init) { |
|
26 | +add_filter('tiny_mce_before_init', function($init) { |
|
27 | 27 | $config = getConfig(); |
28 | 28 | if ($config) { |
29 | 29 | if (isset($config['blockformats'])) { |
@@ -38,11 +38,11 @@ discard block |
||
38 | 38 | return $init; |
39 | 39 | }); |
40 | 40 | |
41 | -add_filter('acf/fields/wysiwyg/toolbars', function ($toolbars) { |
|
41 | +add_filter('acf/fields/wysiwyg/toolbars', function($toolbars) { |
|
42 | 42 | // Load Toolbars and parse them into TinyMCE |
43 | 43 | $config = getConfig(); |
44 | 44 | if ($config && !empty($config['toolbars'])) { |
45 | - $toolbars = array_map(function ($toolbar) { |
|
45 | + $toolbars = array_map(function($toolbar) { |
|
46 | 46 | array_unshift($toolbar, []); |
47 | 47 | return $toolbar; |
48 | 48 | }, $config['toolbars']); |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | function getBlockFormats($blockFormats) |
64 | 64 | { |
65 | 65 | if (!empty($blockFormats)) { |
66 | - $blockFormatStrings = array_map(function ($tag, $label) { |
|
66 | + $blockFormatStrings = array_map(function($tag, $label) { |
|
67 | 67 | return "${label}=${tag}"; |
68 | 68 | }, $blockFormats, array_keys($blockFormats)); |
69 | 69 | return implode(';', $blockFormatStrings); |