fixed tags on endpoint
This commit is contained in:
@@ -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';
|
||||
|
||||
@@ -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),
|
||||
];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user