fixed tags on endpoint

This commit is contained in:
2026-02-01 14:42:36 +01:00
parent 5b8b187143
commit 587ab0da9c
2 changed files with 4 additions and 13 deletions

View File

@@ -9,7 +9,7 @@
* Plugin Name: PartnerExpo Core
* Plugin URI: https://partnerexpo.eu
* Description: A PartnerEXPO oldal belső pluginja
* Version: 1.0.7
* Version: 1.0.8
* Author: Juhász Levente
* Author URI: https://github.com/Duskell/
* License: GPL-2.0+
@@ -23,7 +23,7 @@ if ( ! defined( 'WPINC' ) ) {
die;
}
define( 'PARTNEREXPO_CORE_VERSION', '1.0.7' );
define( 'PARTNEREXPO_CORE_VERSION', '1.0.8' );
function activate_partnerexpo_core() {
require_once plugin_dir_path( __FILE__ ) . 'includes/class-partnerexpo-core-activator.php';

View File

@@ -73,16 +73,7 @@ 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 === 'pexpo_tags') {
$my_term = $term->name; // or ->term_id
break;
}
}
$tags = wp_get_post_terms($post->ID, 'pexpo_tags', ['fields' => 'names']);
$posts[] = [
'id' => $post->ID,
@@ -90,7 +81,7 @@ class Partnerexpo_Core_Public {
'image' => get_the_post_thumbnail_url($post->ID),
'excerpt' => $post->post_excerpt,
'date' => date('Y-m-d', strtotime($post->post_date)),
'tag' => $my_term ?? null,
'tag' => $tags ?? null,
'url' => get_permalink($post),
];
}