@@ -7,11 +7,11 @@ discard block |
||
7 | 7 | use Flynt\Utils\Options; |
8 | 8 | use Flynt\Utils\Asset; |
9 | 9 | |
10 | -add_filter('Flynt/addComponentData?name=ListComponents', function ($data) { |
|
10 | +add_filter('Flynt/addComponentData?name=ListComponents', function($data) { |
|
11 | 11 | if (!empty($data['componentBlocks'])) { |
12 | - $data['componentBlocks'] = array_map(function ($block) { |
|
12 | + $data['componentBlocks'] = array_map(function($block) { |
|
13 | 13 | $componentPaths = explode('/', $block['component']); |
14 | - $block['component'] = implode('/', array_slice($componentPaths, count($componentPaths)-3, 3)); |
|
14 | + $block['component'] = implode('/', array_slice($componentPaths, count($componentPaths) - 3, 3)); |
|
15 | 15 | |
16 | 16 | if (file_exists(Asset::requirePath($block['component'] . 'screenshot.png'))) { |
17 | 17 | $src = Asset::requireUrl($block['component'] . 'screenshot.png'); |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | return $data; |
37 | 37 | }); |
38 | 38 | |
39 | -add_filter('acf/load_field/name=component', function ($field) { |
|
39 | +add_filter('acf/load_field/name=component', function($field) { |
|
40 | 40 | $componentManager = ComponentManager::getInstance(); |
41 | 41 | $field['choices'] = array_flip($componentManager->getAll()); |
42 | 42 | return $field; |
@@ -8,14 +8,14 @@ |
||
8 | 8 | |
9 | 9 | const POST_TYPE = 'post'; |
10 | 10 | |
11 | -add_filter('Flynt/addComponentData?name=GridPostsTeaser', function ($data) { |
|
11 | +add_filter('Flynt/addComponentData?name=GridPostsTeaser', function($data) { |
|
12 | 12 | $postType = POST_TYPE; |
13 | 13 | $data['taxonomies'] = $data['taxonomies'] ?: []; |
14 | 14 | |
15 | 15 | $data['items'] = Timber::get_posts([ |
16 | 16 | 'post_status' => 'publish', |
17 | 17 | 'post_type' => $postType, |
18 | - 'category' => join(',', array_map(function ($taxonomy) { |
|
18 | + 'category' => join(',', array_map(function($taxonomy) { |
|
19 | 19 | return $taxonomy->term_id; |
20 | 20 | }, $data['taxonomies'])), |
21 | 21 | 'posts_per_page' => $data['options']['postCount'], |
@@ -8,14 +8,14 @@ |
||
8 | 8 | |
9 | 9 | const POST_TYPE = 'post'; |
10 | 10 | |
11 | -add_filter('Flynt/addComponentData?name=GridPostsLatest', function ($data) { |
|
11 | +add_filter('Flynt/addComponentData?name=GridPostsLatest', function($data) { |
|
12 | 12 | $postType = POST_TYPE; |
13 | 13 | $data['taxonomies'] = $data['taxonomies'] ?: []; |
14 | 14 | |
15 | 15 | $data['items'] = Timber::get_posts([ |
16 | 16 | 'post_status' => 'publish', |
17 | 17 | 'post_type' => $postType, |
18 | - 'category' => join(',', array_map(function ($taxonomy) { |
|
18 | + 'category' => join(',', array_map(function($taxonomy) { |
|
19 | 19 | return $taxonomy->term_id; |
20 | 20 | }, $data['taxonomies'])), |
21 | 21 | 'posts_per_page' => $data['options']['postCount'], |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | |
9 | 9 | const POST_TYPE = 'post'; |
10 | 10 | |
11 | -add_filter('Flynt/addComponentData?name=GridPostsSlider', function ($data) { |
|
11 | +add_filter('Flynt/addComponentData?name=GridPostsSlider', function($data) { |
|
12 | 12 | $postType = POST_TYPE; |
13 | 13 | |
14 | 14 | $data['taxonomies'] = $data['taxonomies'] ?: []; |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | $data['items'] = Timber::get_posts([ |
17 | 17 | 'post_status' => 'publish', |
18 | 18 | 'post_type' => $postType, |
19 | - 'category' => join(',', array_map(function ($taxonomy) { |
|
19 | + 'category' => join(',', array_map(function($taxonomy) { |
|
20 | 20 | return $taxonomy->term_id; |
21 | 21 | }, $data['taxonomies'])), |
22 | 22 | 'posts_per_page' => 12, |
@@ -4,7 +4,7 @@ |
||
4 | 4 | |
5 | 5 | use Flynt\Utils\Options; |
6 | 6 | |
7 | -add_filter('Flynt/addComponentData?name=BlockPostHeader', function ($data) { |
|
7 | +add_filter('Flynt/addComponentData?name=BlockPostHeader', function($data) { |
|
8 | 8 | |
9 | 9 | return $data; |
10 | 10 | }); |
@@ -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); |
@@ -40,9 +40,9 @@ discard block |
||
40 | 40 | } |
41 | 41 | }); |
42 | 42 | |
43 | -add_action('timber/twig/filters', function ($twig) { |
|
43 | +add_action('timber/twig/filters', function($twig) { |
|
44 | 44 | $twig->addFilter( |
45 | - new Twig_SimpleFilter('resizeDynamic', function ( |
|
45 | + new Twig_SimpleFilter('resizeDynamic', function( |
|
46 | 46 | $src, |
47 | 47 | $w, |
48 | 48 | $h = 0, |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | return $twig; |
85 | 85 | }); |
86 | 86 | |
87 | -Routes::map(IMAGE_ROUTE, function () { |
|
87 | +Routes::map(IMAGE_ROUTE, function() { |
|
88 | 88 | $src = str_replace( |
89 | 89 | '/app/uploads/' . IMAGE_PATH_SEPARATOR . '/', |
90 | 90 | '/app/uploads/', |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | if ($localDev) { |
108 | 108 | $src = http_build_url($homeUrl, ['path' => $urlParts['path']]); |
109 | 109 | } |
110 | - $moveImageFunction = function ($location) { |
|
110 | + $moveImageFunction = function($location) { |
|
111 | 111 | return str_replace( |
112 | 112 | '/app/uploads/', |
113 | 113 | '/app/uploads/' . IMAGE_PATH_SEPARATOR . '/', |
@@ -180,11 +180,11 @@ discard block |
||
180 | 180 | |
181 | 181 | add_filter('mod_rewrite_rules', 'Flynt\\TimberDynamicResize\\addRewriteRule'); |
182 | 182 | |
183 | -add_action('after_switch_theme', function () { |
|
183 | +add_action('after_switch_theme', function() { |
|
184 | 184 | add_action('shutdown', 'flush_rewrite_rules'); |
185 | 185 | }); |
186 | 186 | |
187 | -add_action('switch_theme', function () { |
|
187 | +add_action('switch_theme', function() { |
|
188 | 188 | remove_filter('mod_rewrite_rules', 'Flynt\\TimberDynamicResize\\addRewriteRule'); |
189 | 189 | flush_rewrite_rules(); |
190 | 190 | }); |
@@ -36,7 +36,7 @@ |
||
36 | 36 | |
37 | 37 | if (!$acfActive) { |
38 | 38 | self::notifyRequiredPluginIsMissing('ACF'); |
39 | - add_filter('template_include', function () { |
|
39 | + add_filter('template_include', function() { |
|
40 | 40 | die( |
41 | 41 | 'One or more required plugins are not activated! Please <a href="' |
42 | 42 | . esc_url(admin_url('plugins.php')) |
@@ -7,7 +7,7 @@ |
||
7 | 7 | require __DIR__ . '/fields.php'; |
8 | 8 | require __DIR__ . '/helpers.php'; |
9 | 9 | |
10 | -add_filter('Flynt/addComponentData?name=GoogleAnalyticsOptIn', function ($data) { |
|
10 | +add_filter('Flynt/addComponentData?name=GoogleAnalyticsOptIn', function($data) { |
|
11 | 11 | $googleAnalyticsOptions = Options::get('globalOptions', 'component', 'GoogleAnalyticsAndOptInSettings'); |
12 | 12 | |
13 | 13 | if ($googleAnalyticsOptions) { |