From 4d2acfcf4e670290fb4f7ab7dde57c3fc8005a65 Mon Sep 17 00:00:00 2001 From: Leo Germani Date: Mon, 16 Sep 2019 19:48:27 -0300 Subject: [PATCH] allow terms fetch o get just an ID as paramater --- src/classes/repositories/class-tainacan-terms.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/classes/repositories/class-tainacan-terms.php b/src/classes/repositories/class-tainacan-terms.php index 698a5aa37..18888140b 100644 --- a/src/classes/repositories/class-tainacan-terms.php +++ b/src/classes/repositories/class-tainacan-terms.php @@ -235,8 +235,8 @@ class Terms extends Repository { } return $return; - } elseif ( is_numeric( $args ) && ! empty( $cpt ) && ! is_array( $cpt ) ) { // if an id is passed taxonomy cannot be an array - $wp_term = get_term_by( 'id', $args, $cpt ); + } elseif ( is_numeric( $args ) ) { + $wp_term = get_term( (int) $args, $cpt ); $tainacan_term = new Entities\Term( $wp_term ); return $tainacan_term; } else {