admin管理员组文章数量:1289832
I have a plugin created with boilerplate from this site: /
And I would like to understand how to automatically add 4 entries in the custom taxonomy category that I have already processed.
I guess this code goes on the activator.php file, but I don't know what code to apply to automatically generate these 4 categories.
Can you guys help me?
UPDATE:
Flipping around a bit more I found this code, but it still doesn't work. Is there perhaps some expedient to consider?
add_action('init', 'add_sexes', 100);
function add_gender()
{
wp_insert_term(
'Male', // the term
'Gender', // the taxonomy
array(
'slug' => 'Male'
)
);
}
The goal is to insert 4 custom taxonomy by default when the plugin is activated. Actually nobody knows how to do that?
本文标签: Add default custom taxonomy to plugin activation
版权声明:本文标题:Add default custom taxonomy to plugin activation 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741486718a2381437.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论