@@ -5,7 +5,7 @@ |
||
5 | 5 | use Flynt\Api; |
6 | 6 | use Flynt\Utils\Options; |
7 | 7 | |
8 | -add_filter('Flynt/addComponentData?name=SliderImages', function ($data) { |
|
8 | +add_filter('Flynt/addComponentData?name=SliderImages', function($data) { |
|
9 | 9 | $translatableOptions = Options::getTranslatable('SliderOptions'); |
10 | 10 | $data['jsonData'] = [ |
11 | 11 | 'options' => array_merge($translatableOptions, $data['options']), |
@@ -3,7 +3,7 @@ discard block |
||
3 | 3 | |
4 | 4 | use Flynt\Utils\Options; |
5 | 5 | |
6 | -add_filter('pre_http_request', function ($preempt, $args, $url) { |
|
6 | +add_filter('pre_http_request', function($preempt, $args, $url) { |
|
7 | 7 | if (strpos($url, 'https://www.youtube.com/oembed') !== false || strpos($url, 'https://vimeo.com/api/oembed') !== false) { |
8 | 8 | $response = wp_cache_get($url, 'oembedCache'); |
9 | 9 | if (!empty($response)) { |
@@ -13,14 +13,14 @@ discard block |
||
13 | 13 | return false; |
14 | 14 | }, 10, 3); |
15 | 15 | |
16 | -add_filter('http_response', function ($response, $args, $url) { |
|
16 | +add_filter('http_response', function($response, $args, $url) { |
|
17 | 17 | if (strpos($url, 'https://www.youtube.com/oembed') !== false || strpos($url, 'https://vimeo.com/api/oembed') !== false) { |
18 | 18 | wp_cache_set($url, $response, 'oembedCache'); |
19 | 19 | } |
20 | 20 | return $response; |
21 | 21 | }, 10, 3); |
22 | 22 | |
23 | -add_filter('acf/fields/google_map/api', function ($api) { |
|
23 | +add_filter('acf/fields/google_map/api', function($api) { |
|
24 | 24 | $apiKey = Options::getGlobal('Acf', 'googleMapsApiKey'); |
25 | 25 | if ($apiKey) { |
26 | 26 | $api['key'] = $apiKey; |
@@ -14,7 +14,7 @@ |
||
14 | 14 | function addOptionsToComponent($data, $componentName) |
15 | 15 | { |
16 | 16 | // get fields for this component |
17 | - $options = array_reduce(array_keys(Options::OPTION_TYPES), function ($carry, $optionType) use ($componentName) { |
|
17 | + $options = array_reduce(array_keys(Options::OPTION_TYPES), function($carry, $optionType) use ($componentName) { |
|
18 | 18 | return array_merge($carry, Options::get($optionType, $componentName)); |
19 | 19 | }, []); |
20 | 20 | // don't overwrite existing data |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | acf_add_local_field_group($fieldGroup); |
88 | 88 | } |
89 | 89 | |
90 | - add_action('current_screen', function ($currentScreen) { |
|
90 | + add_action('current_screen', function($currentScreen) { |
|
91 | 91 | foreach (static::OPTION_TYPES as $optionType => $option) { |
92 | 92 | $isTranslatable = $option['translatable']; |
93 | 93 | $toplevelPageId = 'toplevel_page_' . $optionType; |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | add_filter('acf/settings/current_language', 'Flynt\Utils\Options::getDefaultAcfLanguage', 101); |
103 | 103 | |
104 | 104 | // hide language selector in admin bar |
105 | - add_action('wp_before_admin_bar_render', function () { |
|
105 | + add_action('wp_before_admin_bar_render', function() { |
|
106 | 106 | $adminBar = $GLOBALS['wp_admin_bar']; |
107 | 107 | $adminBar->remove_menu('WPML_ALS'); |
108 | 108 | }); |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | $optionNames = ((static::$registeredOptions[$optionType] ?? [])[$scope] ?? []); |
161 | 161 | return array_combine( |
162 | 162 | $optionNames, |
163 | - array_map(function ($optionName) use ($prefix, $isTranslatable) { |
|
163 | + array_map(function($optionName) use ($prefix, $isTranslatable) { |
|
164 | 164 | $fieldKey = $prefix . $optionName; |
165 | 165 | return static::getOptionField($fieldKey, $isTranslatable); |
166 | 166 | }, $optionNames) |
@@ -243,7 +243,7 @@ discard block |
||
243 | 243 | |
244 | 244 | protected static function prefixFields($fields, $prefix) |
245 | 245 | { |
246 | - return array_map(function ($field) use ($prefix) { |
|
246 | + return array_map(function($field) use ($prefix) { |
|
247 | 247 | $field['name'] = $prefix . '_' . $field['name']; |
248 | 248 | return $field; |
249 | 249 | }, $fields); |
@@ -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 TwigFunction('placeholderImage', function ($width, $height, $color = null) { |
|
70 | +add_action('timber/twig/filters', function($twig) { |
|
71 | + $twig->addFunction(new TwigFunction('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' />" : ''; |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | return $wpdb->prefix . TABLE_NAME; |
18 | 18 | } |
19 | 19 | |
20 | -call_user_func(function () { |
|
20 | +call_user_func(function() { |
|
21 | 21 | $optionName = TABLE_NAME . '_db_version'; |
22 | 22 | |
23 | 23 | $installedVersion = get_option($optionName); |
@@ -46,9 +46,9 @@ discard block |
||
46 | 46 | return $uploadDir['relative']; |
47 | 47 | } |
48 | 48 | |
49 | -add_action('timber/twig/filters', function ($twig) { |
|
49 | +add_action('timber/twig/filters', function($twig) { |
|
50 | 50 | $twig->addFilter( |
51 | - new TwigFilter('resizeDynamic', function ( |
|
51 | + new TwigFilter('resizeDynamic', function( |
|
52 | 52 | $src, |
53 | 53 | $w, |
54 | 54 | $h = 0, |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | |
73 | 73 | global $flyntResizedImages; |
74 | 74 | if (empty($flyntResizedImages)) { |
75 | - add_action('shutdown', function () { |
|
75 | + add_action('shutdown', function() { |
|
76 | 76 | storeResizedUrls(); |
77 | 77 | }, -1); |
78 | 78 | } |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | return $twig; |
92 | 92 | }); |
93 | 93 | |
94 | -Routes::map(IMAGE_ROUTE, function () { |
|
94 | +Routes::map(IMAGE_ROUTE, function() { |
|
95 | 95 | $uploadDirRelative = getRelativeUploadDir(); |
96 | 96 | $src = str_replace( |
97 | 97 | trailingslashit($uploadDirRelative) . IMAGE_PATH_SEPARATOR, |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | if ($localDev) { |
116 | 116 | $src = http_build_url($homeUrl, ['path' => $urlParts['path']]); |
117 | 117 | } |
118 | - $moveImageFunction = function ($location) use ($uploadDirRelative) { |
|
118 | + $moveImageFunction = function($location) use ($uploadDirRelative) { |
|
119 | 119 | return str_replace( |
120 | 120 | $uploadDirRelative, |
121 | 121 | trailingslashit($uploadDirRelative) . IMAGE_PATH_SEPARATOR, |
@@ -191,11 +191,11 @@ discard block |
||
191 | 191 | |
192 | 192 | add_filter('mod_rewrite_rules', 'Flynt\\TimberDynamicResize\\addRewriteRule'); |
193 | 193 | |
194 | -add_action('after_switch_theme', function () { |
|
194 | +add_action('after_switch_theme', function() { |
|
195 | 195 | add_action('shutdown', 'flush_rewrite_rules'); |
196 | 196 | }); |
197 | 197 | |
198 | -add_action('switch_theme', function () { |
|
198 | +add_action('switch_theme', function() { |
|
199 | 199 | remove_filter('mod_rewrite_rules', 'Flynt\\TimberDynamicResize\\addRewriteRule'); |
200 | 200 | flush_rewrite_rules(); |
201 | 201 | }); |
@@ -8,9 +8,9 @@ discard block |
||
8 | 8 | use Flynt\Utils\Asset; |
9 | 9 | use Parsedown; |
10 | 10 | |
11 | -add_filter('Flynt/addComponentData?name=ListComponents', function ($data) { |
|
11 | +add_filter('Flynt/addComponentData?name=ListComponents', function($data) { |
|
12 | 12 | if (!empty($data['componentBlocks'])) { |
13 | - $data['componentBlocks'] = array_map(function ($block) { |
|
13 | + $data['componentBlocks'] = array_map(function($block) { |
|
14 | 14 | $block['component'] = substr($block['component'], strpos($block['component'], 'Components/')); |
15 | 15 | |
16 | 16 | if (file_exists(Asset::requirePath($block['component'] . 'screenshot.png'))) { |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | return $data; |
41 | 41 | }); |
42 | 42 | |
43 | -add_filter('acf/load_field/name=component', function ($field) { |
|
43 | +add_filter('acf/load_field/name=component', function($field) { |
|
44 | 44 | $componentManager = ComponentManager::getInstance(); |
45 | 45 | $field['choices'] = array_flip($componentManager->getAll()); |
46 | 46 | return $field; |
@@ -8,7 +8,7 @@ |
||
8 | 8 | add_filter('the_password_form', function ($output) { |
9 | 9 | $context = Timber::get_context(); |
10 | 10 | $context['form'] = [ |
11 | - 'url' => site_url('/wp-login.php?action=postpass', 'login_post') |
|
11 | + 'url' => site_url('/wp-login.php?action=postpass', 'login_post') |
|
12 | 12 | ]; |
13 | 13 | |
14 | 14 | return Timber::fetch('index.twig', $context); |
@@ -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') |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | |
21 | 21 | $rules = get_option('rewrite_rules'); |
22 | 22 | |
23 | - if (! isset($rules["{$routeName}/(.*?)/?$"])) { |
|
23 | + if (!isset($rules["{$routeName}/(.*?)/?$"])) { |
|
24 | 24 | flush_rewrite_rules(); |
25 | 25 | } |
26 | 26 | } |
@@ -28,12 +28,12 @@ discard block |
||
28 | 28 | function disallowRobots() |
29 | 29 | { |
30 | 30 | if (defined('WPSEO_VERSION')) { |
31 | - add_filter('wpseo_robots', function () { |
|
31 | + add_filter('wpseo_robots', function() { |
|
32 | 32 | return "noindex,nofollow"; |
33 | 33 | }); |
34 | 34 | } else { |
35 | 35 | remove_action('wp_head', 'noindex', 1); |
36 | - add_action('wp_head', function () { |
|
36 | + add_action('wp_head', function() { |
|
37 | 37 | echo "<meta name='robots' content='noindex,nofollow' />\n"; |
38 | 38 | }); |
39 | 39 | } |