fix error deleting taxonomy via api (#229)

This commit is contained in:
leogermani 2019-04-16 10:58:34 -03:00
parent 4d77dd6d7d
commit 95f2f58056
1 changed files with 9 additions and 8 deletions

View File

@ -122,6 +122,7 @@ class REST_Taxonomies_Controller extends REST_Controller {
$item_arr['collections_ids'] = [];
$taxonomy = get_taxonomy( $item->get_db_identifier() );
if (is_object($taxonomy) && isset($taxonomy->object_type) && is_array($taxonomy->object_type)) {
foreach ($taxonomy->object_type as $slug) {
$tax_collection = Repositories\Collections::get_instance()->fetch_by_db_identifier($slug);
@ -131,7 +132,7 @@ class REST_Taxonomies_Controller extends REST_Controller {
}
}
}