@@ -6,7 +6,7 @@ |
||
6 | 6 | { |
7 | 7 | public static function init() |
8 | 8 | { |
9 | - add_filter('acf/fields/google_map/api', function ($api) { |
|
9 | + add_filter('acf/fields/google_map/api', function($api) { |
|
10 | 10 | $apiKey = OptionPages::get('globalOptions', 'feature', 'Acf', 'googleMapsApiKey'); |
11 | 11 | if ($apiKey) { |
12 | 12 | $api['key'] = $apiKey; |
@@ -5,7 +5,7 @@ |
||
5 | 5 | use Flynt\Utils\Asset; |
6 | 6 | use Flynt\Utils\Feature; |
7 | 7 | |
8 | -add_action('wp_enqueue_scripts', function () { |
|
8 | +add_action('wp_enqueue_scripts', function() { |
|
9 | 9 | $jqueryVersion = wp_scripts()->registered['jquery']->ver; |
10 | 10 | wp_deregister_script('jquery'); |
11 | 11 |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | // Load TinyMCE Settings from config file |
9 | 9 | |
10 | 10 | // First Toolbar |
11 | -add_filter('mce_buttons', function ($buttons) { |
|
11 | +add_filter('mce_buttons', function($buttons) { |
|
12 | 12 | $config = getConfig(); |
13 | 13 | if ($config && isset($config['toolbars'])) { |
14 | 14 | $toolbars = $config['toolbars']; |
@@ -20,11 +20,11 @@ discard block |
||
20 | 20 | }); |
21 | 21 | |
22 | 22 | // Second Toolbar |
23 | -add_filter('mce_buttons_2', function ($buttons) { |
|
23 | +add_filter('mce_buttons_2', function($buttons) { |
|
24 | 24 | return []; |
25 | 25 | }); |
26 | 26 | |
27 | -add_filter('tiny_mce_before_init', function ($init) { |
|
27 | +add_filter('tiny_mce_before_init', function($init) { |
|
28 | 28 | $config = getConfig(); |
29 | 29 | if ($config) { |
30 | 30 | if (isset($config['blockformats'])) { |
@@ -39,11 +39,11 @@ discard block |
||
39 | 39 | return $init; |
40 | 40 | }); |
41 | 41 | |
42 | -add_filter('acf/fields/wysiwyg/toolbars', function ($toolbars) { |
|
42 | +add_filter('acf/fields/wysiwyg/toolbars', function($toolbars) { |
|
43 | 43 | // Load Toolbars and parse them into TinyMCE |
44 | 44 | $config = getConfig(); |
45 | 45 | if ($config && !empty($config['toolbars'])) { |
46 | - $toolbars = array_map(function ($toolbar) { |
|
46 | + $toolbars = array_map(function($toolbar) { |
|
47 | 47 | array_unshift($toolbar, []); |
48 | 48 | return $toolbar; |
49 | 49 | }, $config['toolbars']); |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | function getBlockFormats($blockFormats) |
65 | 65 | { |
66 | 66 | if (!empty($blockFormats)) { |
67 | - $blockFormatStrings = array_map(function ($tag, $label) { |
|
67 | + $blockFormatStrings = array_map(function($tag, $label) { |
|
68 | 68 | return "${label}=${tag}"; |
69 | 69 | }, $blockFormats, array_keys($blockFormats)); |
70 | 70 | return implode($blockFormatStrings, ';'); |
@@ -79,14 +79,14 @@ discard block |
||
79 | 79 | $filterNamespace = self::FILTER_NAMESPACES[$category]; |
80 | 80 | $filterName = "{$filterNamespace}/{$name}/Fields/{$groupKey}"; |
81 | 81 | |
82 | - add_filter($filterName, function ($config) use ($groupValue) { |
|
82 | + add_filter($filterName, function($config) use ($groupValue) { |
|
83 | 83 | return $groupValue; |
84 | 84 | }); |
85 | 85 | if (ArrayHelpers::isAssoc($groupValue) && array_key_exists('sub_fields', $groupValue)) { |
86 | 86 | $filterName .= '/SubFields'; |
87 | 87 | $subFields = $groupValue['sub_fields']; |
88 | 88 | |
89 | - add_filter($filterName, function ($subFieldsconfig) use ($subFields) { |
|
89 | + add_filter($filterName, function($subFieldsconfig) use ($subFields) { |
|
90 | 90 | return $subFields; |
91 | 91 | }); |
92 | 92 | |
@@ -108,9 +108,9 @@ discard block |
||
108 | 108 | continue; |
109 | 109 | } |
110 | 110 | $subFieldName = ucfirst($subField['name']); |
111 | - $subFilterName = "{$parentFilterName}/{$subFieldName}"; |
|
111 | + $subFilterName = "{$parentFilterName}/{$subFieldName}"; |
|
112 | 112 | |
113 | - add_filter($subFilterName, function ($subFieldConfig) use ($subField) { |
|
113 | + add_filter($subFilterName, function($subFieldConfig) use ($subField) { |
|
114 | 114 | return $subField; |
115 | 115 | }); |
116 | 116 | } |
@@ -2,7 +2,7 @@ |
||
2 | 2 | |
3 | 3 | namespace Flynt\Features\HideProtectedPosts; |
4 | 4 | |
5 | -add_action('pre_get_posts', function ($query) { |
|
5 | +add_action('pre_get_posts', function($query) { |
|
6 | 6 | if (!$query->is_singular() && !is_admin()) { |
7 | 7 | $query->set('has_password', false); |
8 | 8 | } |
@@ -4,7 +4,7 @@ |
||
4 | 4 | |
5 | 5 | use Flynt\Utils\Asset; |
6 | 6 | |
7 | -add_action('wp_enqueue_scripts', function () { |
|
7 | +add_action('wp_enqueue_scripts', function() { |
|
8 | 8 | Asset::register([ |
9 | 9 | 'type' => 'script', |
10 | 10 | 'name' => 'Flynt/Features/Lodash', |
@@ -16,12 +16,12 @@ discard block |
||
16 | 16 | function disallowRobots() |
17 | 17 | { |
18 | 18 | if (defined('WPSEO_VERSION')) { |
19 | - add_filter('wpseo_robots', function () { |
|
19 | + add_filter('wpseo_robots', function() { |
|
20 | 20 | return "noindex,nofollow"; |
21 | 21 | }); |
22 | 22 | } else { |
23 | 23 | remove_action('wp_head', 'noindex', 1); |
24 | - add_action('wp_head', function () { |
|
24 | + add_action('wp_head', function() { |
|
25 | 25 | echo "<meta name='robots' content='noindex,nofollow' />\n"; |
26 | 26 | }); |
27 | 27 | } |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | |
37 | 37 | $rules = get_option('rewrite_rules'); |
38 | 38 | |
39 | - if (! isset($rules["{$routeName}/(.*?)/?$"])) { |
|
39 | + if (!isset($rules["{$routeName}/(.*?)/?$"])) { |
|
40 | 40 | flush_rewrite_rules(); |
41 | 41 | } |
42 | 42 | } |
@@ -6,7 +6,7 @@ discard block |
||
6 | 6 | |
7 | 7 | define(__NAMESPACE__ . '\NS', __NAMESPACE__ . '\\'); |
8 | 8 | |
9 | -add_action('Flynt/afterRegisterFeatures', function () { |
|
9 | +add_action('Flynt/afterRegisterFeatures', function() { |
|
10 | 10 | $componentManager = Flynt\ComponentManager::getInstance(); |
11 | 11 | $componentWhitelist = []; |
12 | 12 | if (isset($_GET['component']) && !empty($_GET['component'])) { |
@@ -43,21 +43,21 @@ discard block |
||
43 | 43 | { |
44 | 44 | $type = gettype($data); |
45 | 45 | $output = json_encode($data); |
46 | - $result = "<script>console.log({$output});</script>\n"; |
|
46 | + $result = "<script>console.log({$output});</script>\n"; |
|
47 | 47 | echoDebug($result, $postpone); |
48 | 48 | } |
49 | 49 | |
50 | 50 | function consoleTable($data, $postpone = true) |
51 | 51 | { |
52 | 52 | $output = json_encode($data); |
53 | - $result = "<script>console.table({$output});</script>\n"; |
|
53 | + $result = "<script>console.table({$output});</script>\n"; |
|
54 | 54 | echoDebug($result, $postpone); |
55 | 55 | } |
56 | 56 | |
57 | 57 | function echoDebug($data, $postpone) |
58 | 58 | { |
59 | 59 | if ($postpone) { |
60 | - add_action('wp_footer', function () use ($data) { |
|
60 | + add_action('wp_footer', function() use ($data) { |
|
61 | 61 | echo $data; |
62 | 62 | }, 30); |
63 | 63 | } else { |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | |
16 | 16 | add_action('Flynt/afterRegisterFeatures', 'Flynt\Features\Acf\Loader::init'); |
17 | 17 | |
18 | -add_filter('pre_http_request', function ($preempt, $args, $url) { |
|
18 | +add_filter('pre_http_request', function($preempt, $args, $url) { |
|
19 | 19 | if (strpos($url, 'https://www.youtube.com/oembed') !== false || strpos($url, 'https://vimeo.com/api/oembed') !== false) { |
20 | 20 | $response = wp_cache_get($url, 'oembedCache'); |
21 | 21 | if (!empty($response)) { |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | return false; |
26 | 26 | }, 10, 3); |
27 | 27 | |
28 | -add_filter('http_response', function ($response, $args, $url) { |
|
28 | +add_filter('http_response', function($response, $args, $url) { |
|
29 | 29 | if (strpos($url, 'https://www.youtube.com/oembed') !== false || strpos($url, 'https://vimeo.com/api/oembed') !== false) { |
30 | 30 | wp_cache_set($url, $response, 'oembedCache'); |
31 | 31 | } |