fixed tags on endpoint
This commit is contained in:
@@ -9,7 +9,7 @@
|
|||||||
* Plugin Name: PartnerExpo Core
|
* Plugin Name: PartnerExpo Core
|
||||||
* Plugin URI: https://partnerexpo.eu
|
* Plugin URI: https://partnerexpo.eu
|
||||||
* Description: A PartnerEXPO oldal belső pluginja
|
* Description: A PartnerEXPO oldal belső pluginja
|
||||||
* Version: 1.0.7
|
* Version: 1.0.8
|
||||||
* Author: Juhász Levente
|
* Author: Juhász Levente
|
||||||
* Author URI: https://github.com/Duskell/
|
* Author URI: https://github.com/Duskell/
|
||||||
* License: GPL-2.0+
|
* License: GPL-2.0+
|
||||||
@@ -23,7 +23,7 @@ if ( ! defined( 'WPINC' ) ) {
|
|||||||
die;
|
die;
|
||||||
}
|
}
|
||||||
|
|
||||||
define( 'PARTNEREXPO_CORE_VERSION', '1.0.7' );
|
define( 'PARTNEREXPO_CORE_VERSION', '1.0.8' );
|
||||||
|
|
||||||
function activate_partnerexpo_core() {
|
function activate_partnerexpo_core() {
|
||||||
require_once plugin_dir_path( __FILE__ ) . 'includes/class-partnerexpo-core-activator.php';
|
require_once plugin_dir_path( __FILE__ ) . 'includes/class-partnerexpo-core-activator.php';
|
||||||
|
|||||||
@@ -73,16 +73,7 @@ class Partnerexpo_Core_Public {
|
|||||||
$posts = [];
|
$posts = [];
|
||||||
|
|
||||||
foreach ($query->posts as $post) {
|
foreach ($query->posts as $post) {
|
||||||
$terms = wp_get_post_terms($post->ID, 'taxidermy_tags', ['fields' => 'all']);
|
$tags = wp_get_post_terms($post->ID, 'pexpo_tags', ['fields' => 'names']);
|
||||||
$my_term = null;
|
|
||||||
|
|
||||||
foreach ($terms as $term) {
|
|
||||||
if ($term->slug === 'pexpo_tags') {
|
|
||||||
$my_term = $term->name; // or ->term_id
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
$posts[] = [
|
$posts[] = [
|
||||||
'id' => $post->ID,
|
'id' => $post->ID,
|
||||||
@@ -90,7 +81,7 @@ class Partnerexpo_Core_Public {
|
|||||||
'image' => get_the_post_thumbnail_url($post->ID),
|
'image' => get_the_post_thumbnail_url($post->ID),
|
||||||
'excerpt' => $post->post_excerpt,
|
'excerpt' => $post->post_excerpt,
|
||||||
'date' => date('Y-m-d', strtotime($post->post_date)),
|
'date' => date('Y-m-d', strtotime($post->post_date)),
|
||||||
'tag' => $my_term ?? null,
|
'tag' => $tags ?? null,
|
||||||
'url' => get_permalink($post),
|
'url' => get_permalink($post),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user