wordpress查询指定文章的标签的SQL

请将下面的$post_id替换为文章的id:

SELECT
	a.term_id,
	b.`name`,
	b.slug 
FROM
	wp_term_taxonomy a
	INNER JOIN wp_terms b ON a.term_id = b.term_id 
	AND a.taxonomy = 'post_tag' 
WHERE
	a.term_taxonomy_id IN ( SELECT t.term_taxonomy_id FROM wp_term_relationships t WHERE t.object_id = $post_id )
© 版权声明
THE END
喜欢就支持一下吧
点赞0 分享