diff --git a/partnerexpo-core.php b/partnerexpo-core.php index 28a9706..47e4e63 100644 --- a/partnerexpo-core.php +++ b/partnerexpo-core.php @@ -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'; diff --git a/public/class-partnerexpo-core-public.php b/public/class-partnerexpo-core-public.php index 4db98fd..1649e0f 100644 --- a/public/class-partnerexpo-core-public.php +++ b/public/class-partnerexpo-core-public.php @@ -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), ]; }