Dapatkan ID istilah taksonomi dari slug - wordpress

<?php 
    $term = get_term_by('slug', $slug, 'category'); 
    $name = $term->name; 
    $id = $term->term_id;
?>
Adventurous Ant