@@ -4,8 +4,8 @@ discard block |
||
4 | 4 | |
5 | 5 | use Flynt\Features\Components\Component; |
6 | 6 | |
7 | -add_filter('Flynt/addComponentData?name=ListSearchResults', function ($data, $parentData) { |
|
8 | - add_action('wp_enqueue_scripts', function () { |
|
7 | +add_filter('Flynt/addComponentData?name=ListSearchResults', function($data, $parentData) { |
|
8 | + add_action('wp_enqueue_scripts', function() { |
|
9 | 9 | Component::enqueueAssets('ListSearchResults'); |
10 | 10 | }); |
11 | 11 | |
@@ -18,6 +18,6 @@ discard block |
||
18 | 18 | if (!isset($data['postsCount']) && isset($parentData['postsCount'])) { |
19 | 19 | $data['postsCount'] = $parentData['postsCount']; |
20 | 20 | } |
21 | -var_dump($data['postsCount']);die(); |
|
21 | +var_dump($data['postsCount']); die(); |
|
22 | 22 | return $data; |
23 | 23 | }, 10, 2); |
@@ -6,15 +6,15 @@ |
||
6 | 6 | use Flynt\Features\Components\Component; |
7 | 7 | use WP_Query; |
8 | 8 | |
9 | -add_action('wp_enqueue_scripts', function () { |
|
9 | +add_action('wp_enqueue_scripts', function() { |
|
10 | 10 | Component::enqueueAssets('LayoutMultiplePosts'); |
11 | 11 | }); |
12 | 12 | |
13 | -add_filter('Flynt/addComponentData?name=LayoutMultiplePosts', function ($data) { |
|
13 | +add_filter('Flynt/addComponentData?name=LayoutMultiplePosts', function($data) { |
|
14 | 14 | $query = !empty($data['query']) ? $data['query'] : false; |
15 | 15 | $posts = Timber::get_posts($query); |
16 | 16 | if (!empty($posts)) { |
17 | - $posts = array_map(function ($post) { |
|
17 | + $posts = array_map(function($post) { |
|
18 | 18 | $fields = get_fields($post->id); |
19 | 19 | $post->fields = $fields === false ? [] : $fields; |
20 | 20 | return $post; |