registrando todas as taxonomias na criação do item

This commit is contained in:
Eduardo humberto 2017-11-10 09:39:45 -02:00
parent 3530d403d8
commit f1ca439b04
1 changed files with 8 additions and 3 deletions

View File

@ -68,11 +68,16 @@ class TainacanItems {
'capability_type' => 'post', 'capability_type' => 'post',
); );
register_post_type($cpt_slug, $args); register_post_type($cpt_slug, $args);
$this->register_post_type_taxonomies( $cpt_slug, $taxonomies );
}
}
function register_post_type_taxonomies( $cpt_slug, $taxonomies ){
foreach ($taxonomies as $taxonomy) { foreach ($taxonomies as $taxonomy) {
register_taxonomy_for_object_type( $taxonomy, $cpt_slug ); register_taxonomy_for_object_type( $taxonomy, $cpt_slug );
} }
} }
}
function insert(TainacanItem $item) { function insert(TainacanItem $item) {