admin管理员组文章数量:1130213
I'm migrating some posts from another source to WordPress, specifically to a theme/plugin called Madara, which has some specific taxonomies. I'm using wp_insert_post()
to create the post, everything works fine until I try to set the taxonomies, I tried to set the taxonomies directly via the tax_input
array on the wp_insert_post()
, even with a post_auhtor
defined and the wp_set_current_user()
set, it didn't work.
I also tried with the wp_set_object_terms()
after creating the post, but I've getting Invalid taxonomy
error.
this is a sample screenshot taken from the "Quick Edit" request on admin panel, basically the same way I'm defining in on wp_insert_post()
Important: This is not a regular wordpress plugin, it is a cron job that's just using WordPress functions.
Wordpress files being included in the cron code:
require_once "../../../wp-load.php";
require_once "../../../wp-admin/includes/taxonomy.php";
require_once "../../../wp-admin/includes/file.php";
require_once "../../../wp-admin/includes/image.php";
require_once "../../../wp-admin/includes/media.php";
How can I add those taxonomies?
本文标签: taxonomyCannot set custom taxonomies when creating post
版权声明:本文标题:taxonomy - Cannot set custom taxonomies when creating post 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736755924a1951287.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论