【发布时间】:2016-08-22 19:28:11
【问题描述】:
我从this example创建了自定义字段
我想通过在 phpmyadmin 的 mysql 查询中在 custom_term_meta(created new field) 中包含“web”来获取分类名称。
【问题讨论】:
标签: mysql wordpress custom-taxonomy
我从this example创建了自定义字段
我想通过在 phpmyadmin 的 mysql 查询中在 custom_term_meta(created new field) 中包含“web”来获取分类名称。
【问题讨论】:
标签: mysql wordpress custom-taxonomy
WordPress 4.4 及更高版本内置了 Term Meta:https://www.smashingmagazine.com/2015/12/how-to-use-term-meta-data-in-wordpress/
但在您的示例中,您将术语元存储在 wp_options 表中。您应该像这样通过 get_option() 函数获取值:
echo get_option("taxonomy_$term_id");
... 其中 $term_id 是您想要获取元数据的术语的 ID。
【讨论】: