@@ -5,7 +5,7 @@ |
||
5 | 5 | use Flynt\Api; |
6 | 6 | use Flynt\Utils\Oembed; |
7 | 7 | |
8 | -add_filter('Flynt/addComponentData?name=BlockVideoOembed', function ($data) { |
|
8 | +add_filter('Flynt/addComponentData?name=BlockVideoOembed', function($data) { |
|
9 | 9 | $data['video'] = Oembed::setSrcAsDataAttribute( |
10 | 10 | $data['oembed'], |
11 | 11 | [ |
@@ -3,7 +3,7 @@ |
||
3 | 3 | use ACFComposer\ACFComposer; |
4 | 4 | use Flynt\Api; |
5 | 5 | |
6 | -add_action('Flynt/afterRegisterComponents', function () { |
|
6 | +add_action('Flynt/afterRegisterComponents', function() { |
|
7 | 7 | ACFComposer::registerFieldGroup([ |
8 | 8 | 'name' => 'pageComponents', |
9 | 9 | 'title' => 'Page Components', |
@@ -3,7 +3,7 @@ |
||
3 | 3 | use ACFComposer\ACFComposer; |
4 | 4 | use Flynt\Api; |
5 | 5 | |
6 | -add_action('Flynt/afterRegisterComponents', function () { |
|
6 | +add_action('Flynt/afterRegisterComponents', function() { |
|
7 | 7 | ACFComposer::registerFieldGroup([ |
8 | 8 | 'name' => 'postComponents', |
9 | 9 | 'title' => 'Post Components', |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | namespace Flynt\TinyMce; |
17 | 17 | |
18 | 18 | // First Toolbar |
19 | -add_filter('mce_buttons', function ($buttons) { |
|
19 | +add_filter('mce_buttons', function($buttons) { |
|
20 | 20 | $config = getConfig(); |
21 | 21 | if ($config && isset($config['toolbars'])) { |
22 | 22 | $toolbars = $config['toolbars']; |
@@ -28,11 +28,11 @@ discard block |
||
28 | 28 | }); |
29 | 29 | |
30 | 30 | // Second Toolbar |
31 | -add_filter('mce_buttons_2', function ($buttons) { |
|
31 | +add_filter('mce_buttons_2', function($buttons) { |
|
32 | 32 | return []; |
33 | 33 | }); |
34 | 34 | |
35 | -add_filter('tiny_mce_before_init', function ($init) { |
|
35 | +add_filter('tiny_mce_before_init', function($init) { |
|
36 | 36 | $config = getConfig(); |
37 | 37 | if ($config) { |
38 | 38 | if (isset($config['blockformats'])) { |
@@ -47,11 +47,11 @@ discard block |
||
47 | 47 | return $init; |
48 | 48 | }); |
49 | 49 | |
50 | -add_filter('acf/fields/wysiwyg/toolbars', function ($toolbars) { |
|
50 | +add_filter('acf/fields/wysiwyg/toolbars', function($toolbars) { |
|
51 | 51 | // Load Toolbars and parse them into TinyMCE |
52 | 52 | $config = getConfig(); |
53 | 53 | if ($config && !empty($config['toolbars'])) { |
54 | - $toolbars = array_map(function ($toolbar) { |
|
54 | + $toolbars = array_map(function($toolbar) { |
|
55 | 55 | array_unshift($toolbar, []); |
56 | 56 | return $toolbar; |
57 | 57 | }, $config['toolbars']); |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | function getBlockFormats($blockFormats) |
63 | 63 | { |
64 | 64 | if (!empty($blockFormats)) { |
65 | - $blockFormatStrings = array_map(function ($tag, $label) { |
|
65 | + $blockFormatStrings = array_map(function($tag, $label) { |
|
66 | 66 | return "${label}=${tag}"; |
67 | 67 | }, $blockFormats, array_keys($blockFormats)); |
68 | 68 | return implode(';', $blockFormatStrings); |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | |
27 | 27 | // Convert ACF Field of type relationship to a Timber\Post and add all ACF Fields of that Post |
28 | 28 | add_filter('acf/format_value/type=relationship', NS . 'formatPostObject', 100); |
29 | -add_filter('get_twig', function ($twig) { |
|
29 | +add_filter('get_twig', function($twig) { |
|
30 | 30 | $twig->addExtension(new TwigExtensionFlynt()); |
31 | 31 | return $twig; |
32 | 32 | }); |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | function formatGallery($value) |
43 | 43 | { |
44 | 44 | if (!empty($value)) { |
45 | - $value = array_map(function ($image) { |
|
45 | + $value = array_map(function($image) { |
|
46 | 46 | return new Image($image); |
47 | 47 | }, $value); |
48 | 48 | } |
@@ -67,8 +67,8 @@ discard block |
||
67 | 67 | return $value; |
68 | 68 | } |
69 | 69 | |
70 | -add_action('timber/twig/filters', function ($twig) { |
|
71 | - $twig->addFunction(new \Twig_SimpleFunction('placeholderImage', function ($width, $height, $color = null) { |
|
70 | +add_action('timber/twig/filters', function($twig) { |
|
71 | + $twig->addFunction(new \Twig_SimpleFunction('placeholderImage', function($width, $height, $color = null) { |
|
72 | 72 | $width = round($width); |
73 | 73 | $height = round($height); |
74 | 74 | $colorRect = $color ? "<rect width='{$width}' height='{$height}' style='fill:$color' />" : ''; |
@@ -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 { |
@@ -21,12 +21,12 @@ discard block |
||
21 | 21 | function disallowRobots() |
22 | 22 | { |
23 | 23 | if (defined('WPSEO_VERSION')) { |
24 | - add_filter('wpseo_robots', function () { |
|
24 | + add_filter('wpseo_robots', function() { |
|
25 | 25 | return "noindex,nofollow"; |
26 | 26 | }); |
27 | 27 | } else { |
28 | 28 | remove_action('wp_head', 'noindex', 1); |
29 | - add_action('wp_head', function () { |
|
29 | + add_action('wp_head', function() { |
|
30 | 30 | echo "<meta name='robots' content='noindex,nofollow' />\n"; |
31 | 31 | }); |
32 | 32 | } |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | |
42 | 42 | $rules = get_option('rewrite_rules'); |
43 | 43 | |
44 | - if (! isset($rules["{$routeName}/(.*?)/?$"])) { |
|
44 | + if (!isset($rules["{$routeName}/(.*?)/?$"])) { |
|
45 | 45 | flush_rewrite_rules(); |
46 | 46 | } |
47 | 47 | } |
@@ -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 | } |