Answers:
请参阅食典的WordPress分类标准文档。
WordPress 2.3用三个更灵活的分类表集替换了以前的类别post2cat和link2cat表。
wp_terms
wp_term_relationships
wp_term_taxonomy
wp_terms-包含有关单个术语的基本信息。
term_id bigint(20) unsigned NOT NULL auto_increment,
name varchar(200) NOT NULL default '',
slug varchar(200) NOT NULL default '',
term_group bigint(10) NOT NULL default 0,
PRIMARY KEY (term_id),
UNIQUE KEY slug (slug),
KEY name (name)
wp_term_taxonomy-定义分类法-标签,类别或自定义分类法
term_taxonomy_id bigint(20) unsigned NOT NULL auto_increment,
term_id bigint(20) unsigned NOT NULL default 0,
taxonomy varchar(32) NOT NULL default '',
description longtext NOT NULL,
parent bigint(20) unsigned NOT NULL default 0,
count bigint(20) NOT NULL default 0,
PRIMARY KEY (term_taxonomy_id),
UNIQUE KEY term_id_taxonomy (term_id,taxonomy),
KEY taxonomy (taxonomy)
wp_term_relationships-包含WordPress对象之间的多对多关系,例如post或来自term_taxonomy表中的term_taxonomy_id的链接。
object_id bigint(20) unsigned NOT NULL default 0,
term_taxonomy_id bigint(20) unsigned NOT NULL default 0,
term_order int(11) NOT NULL default 0,
PRIMARY KEY (object_id,term_taxonomy_id),
KEY term_taxonomy_id (term_taxonomy_id)