@@ -15,7 +15,7 @@ discard block |
||
| 15 | 15 | } |
| 16 | 16 | } |
| 17 | 17 | |
| 18 | -add_filter('wp_insert_post_data', function ($data, $postArr) { |
|
| 18 | +add_filter('wp_insert_post_data', function($data, $postArr) { |
|
| 19 | 19 | if (in_array( |
| 20 | 20 | $postArr['post_type'], |
| 21 | 21 | [ |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | return $data; |
| 35 | 35 | }, 99, 2); |
| 36 | 36 | |
| 37 | -add_shortcode('flyntTheContent', function ($attrs) { |
|
| 37 | +add_shortcode('flyntTheContent', function($attrs) { |
|
| 38 | 38 | $postId = $attrs['id']; |
| 39 | 39 | // in case the post id was not set correctly and is 0 |
| 40 | 40 | if (!empty($postId)) { |
@@ -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 (is_array($value)) { |
| 32 | 32 | $rawGroupValues = $value; |
| 33 | 33 | } elseif (!empty($value) && is_string($value)) { |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | function replaceUpdateValueGroupField($groupField) |
| 48 | 48 | { |
| 49 | 49 | remove_filter('acf/update_value/type=group', [$groupField, 'update_value'], 10); |
| 50 | - add_filter('acf/update_value/type=group', function ($value, $postId, $field) use ($groupField) { |
|
| 50 | + add_filter('acf/update_value/type=group', function($value, $postId, $field) use ($groupField) { |
|
| 51 | 51 | if (!acf_is_array($value)) { |
| 52 | 52 | return null; |
| 53 | 53 | }; |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | function replaceLoadValueRepeaterField($repeaterField) |
| 81 | 81 | { |
| 82 | 82 | remove_filter('acf/load_value/type=repeater', [$repeaterField, 'load_value'], 10); |
| 83 | - add_filter('acf/load_value/type=repeater', function ($value, $postId, $field) use ($repeaterField) { |
|
| 83 | + add_filter('acf/load_value/type=repeater', function($value, $postId, $field) use ($repeaterField) { |
|
| 84 | 84 | if (!empty($value) && is_string($value)) { |
| 85 | 85 | $value = json_decode($value, true); |
| 86 | 86 | } |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | function replaceUpdateValueRepeaterField($repeaterField) |
| 107 | 107 | { |
| 108 | 108 | remove_filter('acf/update_value/type=repeater', [$repeaterField, 'update_value'], 10); |
| 109 | - add_filter('acf/update_value/type=repeater', function ($value, $postId, $field) use ($repeaterField) { |
|
| 109 | + add_filter('acf/update_value/type=repeater', function($value, $postId, $field) use ($repeaterField) { |
|
| 110 | 110 | if (empty($field['sub_fields'])) { |
| 111 | 111 | return $value; |
| 112 | 112 | }; |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | function replaceLoadValueFlexibleContentField($flexibleContentField) |
| 150 | 150 | { |
| 151 | 151 | remove_filter('acf/load_value/type=flexible_content', [$flexibleContentField, 'load_value'], 10); |
| 152 | - add_filter('acf/load_value/type=flexible_content', function ($value, $postId, $field) use ($flexibleContentField) { |
|
| 152 | + add_filter('acf/load_value/type=flexible_content', function($value, $postId, $field) use ($flexibleContentField) { |
|
| 153 | 153 | if (!empty($value) && is_string($value)) { |
| 154 | 154 | $rawFlexibleContentValues = json_decode($value, true); |
| 155 | 155 | } elseif (is_array($value) && isset($value[0]['acf_fc_layout'])) { |
@@ -181,7 +181,7 @@ discard block |
||
| 181 | 181 | function replaceUpdateValueFlexibleContentField($flexibleContentField) |
| 182 | 182 | { |
| 183 | 183 | remove_filter('acf/update_value/type=flexible_content', [$flexibleContentField, 'update_value'], 10); |
| 184 | - add_filter('acf/update_value/type=flexible_content', function ($value, $postId, $field) use ($flexibleContentField) { |
|
| 184 | + add_filter('acf/update_value/type=flexible_content', function($value, $postId, $field) use ($flexibleContentField) { |
|
| 185 | 185 | if (empty($field['layouts'])) { |
| 186 | 186 | return $value; |
| 187 | 187 | } |