Hey,
i am new with sage. I want to get the tags from the post.
for CPT I use a function:
public function ReviewItems() {
$review_items = get_posts([
‘post_type’ => ‘reviews’,
‘posts_per_page’=>‘100’,
‘orderby’=>‘date’,
‘order’ => ‘ASC’,
]);
return array_map(function ($post) {
return [
'title' => apply_filters('the_title', $post->post_title),
'date' => get_the_date(('d / F'), $post->ID),
'excerpt' => apply_filters('the_excerpt', $post->post_excerpt),
'thumbnail' => get_the_post_thumbnail($post->ID, 'medium'),
'link' => get_the_permalink($post->ID),
'aria' => apply_filters('the_title','aria-label='.$post->post_title),
'name' => apply_filters('the_title','title='.$post->post_title),
'from' => get_field( 'review_author', $post->ID ),
'terms' => get_the_tags( $post->ID),
];
}, $review_items);
}
FRONTEND:
{!! $review_item[‘terms’] !!}
returns only “ARRAY”
what is the correct way to get the array?