@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | return $wpdb->prefix . TABLE_NAME; |
19 | 19 | } |
20 | 20 | |
21 | -call_user_func(function () { |
|
21 | +call_user_func(function() { |
|
22 | 22 | $optionName = TABLE_NAME . '_db_version'; |
23 | 23 | |
24 | 24 | $installedVersion = get_option($optionName); |
@@ -47,9 +47,9 @@ discard block |
||
47 | 47 | return $uploadDir['relative']; |
48 | 48 | } |
49 | 49 | |
50 | -add_action('timber/twig/filters', function ($twig) { |
|
50 | +add_action('timber/twig/filters', function($twig) { |
|
51 | 51 | $twig->addFilter( |
52 | - new TwigFilter('resizeDynamic', function ( |
|
52 | + new TwigFilter('resizeDynamic', function( |
|
53 | 53 | $src, |
54 | 54 | $w, |
55 | 55 | $h = 0, |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | |
74 | 74 | global $flyntResizedImages; |
75 | 75 | if (empty($flyntResizedImages)) { |
76 | - add_action('shutdown', function () { |
|
76 | + add_action('shutdown', function() { |
|
77 | 77 | storeResizedUrls(); |
78 | 78 | }, -1); |
79 | 79 | } |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | add_rewrite_tag("%{$routeName}%", "([^&]+)"); |
101 | 101 | } |
102 | 102 | |
103 | -add_action('parse_request', function ($wp) { |
|
103 | +add_action('parse_request', function($wp) { |
|
104 | 104 | if (isset($wp->query_vars[IMAGE_ROUTE])) { |
105 | 105 | generateImage(); |
106 | 106 | } |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | if ($localDev) { |
132 | 132 | $src = http_build_url($homeUrl, ['path' => $urlParts['path']]); |
133 | 133 | } |
134 | - $moveImageFunction = function ($location) use ($uploadDirRelative) { |
|
134 | + $moveImageFunction = function($location) use ($uploadDirRelative) { |
|
135 | 135 | return str_replace( |
136 | 136 | $uploadDirRelative, |
137 | 137 | trailingslashit($uploadDirRelative) . IMAGE_PATH_SEPARATOR, |
@@ -207,11 +207,11 @@ discard block |
||
207 | 207 | |
208 | 208 | add_filter('mod_rewrite_rules', 'Flynt\\TimberDynamicResize\\addRewriteRule'); |
209 | 209 | |
210 | -add_action('after_switch_theme', function () { |
|
210 | +add_action('after_switch_theme', function() { |
|
211 | 211 | add_action('shutdown', 'flush_rewrite_rules'); |
212 | 212 | }); |
213 | 213 | |
214 | -add_action('switch_theme', function () { |
|
214 | +add_action('switch_theme', function() { |
|
215 | 215 | remove_filter('mod_rewrite_rules', 'Flynt\\TimberDynamicResize\\addRewriteRule'); |
216 | 216 | flush_rewrite_rules(); |
217 | 217 | }); |
@@ -2,7 +2,7 @@ discard block |
||
2 | 2 | |
3 | 3 | namespace Flynt\AcfPerformance; |
4 | 4 | |
5 | -add_action('acf/init', function () { |
|
5 | +add_action('acf/init', function() { |
|
6 | 6 | $types = acf()->fields->types; |
7 | 7 | replaceLoadValue($types); |
8 | 8 | if (defined('FLYNT_ACF_EXPERIMENTAL')) { |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | function replaceLoadValueGroupField($groupField) |
28 | 28 | { |
29 | 29 | remove_filter('acf/load_value/type=group', [$groupField, 'load_value'], 10); |
30 | - add_filter('acf/load_value/type=group', function ($value, $postId, $field) use ($groupField) { |
|
30 | + add_filter('acf/load_value/type=group', function($value, $postId, $field) use ($groupField) { |
|
31 | 31 | if (!empty($value) && is_string($value)) { |
32 | 32 | return json_decode($value, true); |
33 | 33 | } else { |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | function replaceUpdateValueGroupField($groupField) |
40 | 40 | { |
41 | 41 | remove_filter('acf/update_value/type=group', [$groupField, 'update_value'], 10); |
42 | - add_filter('acf/update_value/type=group', function ($value, $postId, $field) use ($groupField) { |
|
42 | + add_filter('acf/update_value/type=group', function($value, $postId, $field) use ($groupField) { |
|
43 | 43 | if (!acf_is_array($value)) { |
44 | 44 | return null; |
45 | 45 | }; |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | function replaceLoadValueRepeaterField($repeaterField) |
66 | 66 | { |
67 | 67 | remove_filter('acf/load_value/type=repeater', [$repeaterField, 'load_value'], 10); |
68 | - add_filter('acf/load_value/type=repeater', function ($value, $postId, $field) use ($repeaterField) { |
|
68 | + add_filter('acf/load_value/type=repeater', function($value, $postId, $field) use ($repeaterField) { |
|
69 | 69 | if (!empty($value) && is_string($value)) { |
70 | 70 | $value = json_decode($value, true); |
71 | 71 | } |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | function replaceUpdateValueRepeaterField($repeaterField) |
81 | 81 | { |
82 | 82 | remove_filter('acf/update_value/type=repeater', [$repeaterField, 'update_value'], 10); |
83 | - add_filter('acf/update_value/type=repeater', function ($value, $postId, $field) use ($repeaterField) { |
|
83 | + add_filter('acf/update_value/type=repeater', function($value, $postId, $field) use ($repeaterField) { |
|
84 | 84 | // die(); |
85 | 85 | if (empty($field['sub_fields'])) { |
86 | 86 | return $value; |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | function replaceLoadValueFlexibleContentField($flexibleContentField) |
119 | 119 | { |
120 | 120 | remove_filter('acf/load_value/type=flexible_content', [$flexibleContentField, 'load_value'], 10); |
121 | - add_filter('acf/load_value/type=flexible_content', function ($value, $postId, $field) use ($flexibleContentField) { |
|
121 | + add_filter('acf/load_value/type=flexible_content', function($value, $postId, $field) use ($flexibleContentField) { |
|
122 | 122 | if (!empty($value) && is_string($value)) { |
123 | 123 | return json_decode($value, true); |
124 | 124 | } else { |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | function replaceUpdateValueFlexibleContentField($flexibleContentField) |
131 | 131 | { |
132 | 132 | remove_filter('acf/update_value/type=flexible_content', [$flexibleContentField, 'update_value'], 10); |
133 | - add_filter('acf/update_value/type=flexible_content', function ($value, $postId, $field) use ($flexibleContentField) { |
|
133 | + add_filter('acf/update_value/type=flexible_content', function($value, $postId, $field) use ($flexibleContentField) { |
|
134 | 134 | if (empty($field['layouts'])) { |
135 | 135 | return $value; |
136 | 136 | } |