wp_set_object_terms()返回invalid_taxonomy

时间:2016-02-17 13:28:21

标签: wordpress wordpress-plugin taxonomy custom-taxonomy

我试图设置帖子的分类,但它总是返回invalid_taxonomy错误。

$categorys_ids = wp_set_object_terms($post_id, $categorys, 'categorie-video');
            error_log('categorys brut = ' . $data['category'] .'postid '.$post_id.'categorys = ' . json_encode($categorys_ids));

            //byme
            if (is_wp_error($categorys_ids)) {
                error_log('categorys =There was an error somewhere and the terms couldn\'t be set');
            } else {
                error_log('categorys =Success! The post\'s categories were set.');
            }

0 个答案:

没有答案