Get a taxonomy term object by it’s slug

Set up the object for the taxonomy term:

$taxonomy_term = get_term_by('slug', $taxonomy_term_slug, $taxonomy);

Then you can use the object like this:

$taxonomy_term_name = $taxonomy_term->name;

Here’s everything available in the object:

term_id
name
slug
term_group
term_taxonomy_id
taxonomy
description
parent
count

Revisions

Tags: ,

No comments yet.

Leave a Reply