allow terms fetch o get just an ID as paramater

This commit is contained in:
Leo Germani 2019-09-16 19:48:27 -03:00
parent 5bd3c89a97
commit 4d2acfcf4e
1 changed files with 2 additions and 2 deletions

View File

@ -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 {