return new WP_Error( 'invalid_taxonomy',
__( 'Invalid taxonomy.'
) );
} $_term =
sanitize_term( $_term,
$_term->taxonomy, 'raw'
);
// Don't cache terms that are shared between taxonomies.
if ( 1 ===
count( $terms ) ) { wp_cache_add( $term_id,
$_term, 'terms'
);
} } $term_obj =
new WP_Term( $_term );
$term_obj->
filter( $term_obj->filter
);
return $term_obj;
} /**
* Constructor.
*
* @since 4.4.0
*
* @param WP_Term|object $term Term object.
*/