The latest term means it’ll have the highest term_ID right, So we’re sorting terms in DESC
order and getting first array element of the result in $latest_mailer
variable.
Here’s code to do that, not tested but if didn’t worked – you can modify get_terms()
function to return term with higest id
.
$mailer = get_terms('mailers','orderby=id&order=DESC&number=1');
$latest_mailer = $mailer[0]->slug;