updated the cpt and others
This commit is contained in:
@@ -73,12 +73,24 @@ class Partnerexpo_Core_Public {
|
||||
$posts = [];
|
||||
|
||||
foreach ($query->posts as $post) {
|
||||
$terms = wp_get_post_terms($post->ID, 'taxidermy_tags', ['fields' => 'all']);
|
||||
$my_term = null;
|
||||
|
||||
foreach ($terms as $term) {
|
||||
if ($term->slug === 'tags') {
|
||||
$my_term = $term->name; // or ->term_id
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$posts[] = [
|
||||
'id' => $post->ID,
|
||||
'title' => $post->post_title,
|
||||
'image' => get_the_post_thumbnail_url($post->ID),
|
||||
'excerpt' => $post->post_excerpt,
|
||||
'modif' => $post->post_modified,
|
||||
'date' => date('Y-m-d', strtotime($post->post_date)),
|
||||
'tag' => $my_term ?? null,
|
||||
'url' => get_permalink($post),
|
||||
];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user