Query for tag given slug

时间:2011-04-05 作者:JM at Work

如何查询给定slug的标记?

1 个回复
最合适的回答,由SO网友:MikeSchinkel 整理而成

你好@JM at Work:

像这样:

$term_slug = \'foo\';
$term_object = get_term_by( \'slug\', $term_slug, \'post_tag\' );
print_r( $term_object );

结束

相关推荐