@@ -5,8 +5,8 @@ |
||
| 5 | 5 | use Timber\Timber; |
| 6 | 6 | use Flynt\Features\Components\Component; |
| 7 | 7 | |
| 8 | -add_filter('Flynt/addComponentData?name=LayoutSinglePost', function ($data) { |
|
| 9 | - add_action('wp_enqueue_scripts', function () { |
|
| 8 | +add_filter('Flynt/addComponentData?name=LayoutSinglePost', function($data) { |
|
| 9 | + add_action('wp_enqueue_scripts', function() { |
|
| 10 | 10 | Component::enqueueAssets('LayoutSinglePost'); |
| 11 | 11 | }); |
| 12 | 12 | |
@@ -5,15 +5,15 @@ |
||
| 5 | 5 | use Timber\Timber; |
| 6 | 6 | use Flynt\Features\Components\Component; |
| 7 | 7 | |
| 8 | -add_filter('Flynt/addComponentData?name=LayoutMultiplePosts', function ($data) { |
|
| 9 | - add_action('wp_enqueue_scripts', function () { |
|
| 8 | +add_filter('Flynt/addComponentData?name=LayoutMultiplePosts', function($data) { |
|
| 9 | + add_action('wp_enqueue_scripts', function() { |
|
| 10 | 10 | Component::enqueueAssets('LayoutMultiplePosts'); |
| 11 | 11 | }); |
| 12 | 12 | |
| 13 | 13 | $query = !empty($data['query']) ? $data['query'] : false; |
| 14 | 14 | $posts = Timber::get_posts($query); |
| 15 | 15 | if (!empty($posts)) { |
| 16 | - $posts = array_map(function ($post) { |
|
| 16 | + $posts = array_map(function($post) { |
|
| 17 | 17 | $fields = get_fields($post->id); |
| 18 | 18 | $post->fields = $fields === false ? [] : $fields; |
| 19 | 19 | return $post; |