mercredi 17 février 2016

wp_set_object_terms() return invalid_taxonomy

i tried to set the taxonomy of a post but it always return invalid_taxonomy error.

$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.');
            }



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire