fix: validate allow new terms of create a auto-draft item

This commit is contained in:
vnmedeiros 2021-06-07 12:28:06 -03:00
parent 3db120a8c3
commit efe518e474
2 changed files with 3 additions and 3 deletions

View File

@ -883,7 +883,7 @@ class REST_Items_Controller extends REST_Controller {
return new \WP_REST_Response( [
'error_message' => __( 'Please verify, invalid value(s)', 'tainacan' ),
'errors' => $item_metadata->get_errors(),
'item_metadata' => $this->prepare_item_for_response($item_metadata, $request),
'item_metadata' => $this->prepare_item_for_response($item_metadata->get_item(), $request),
], 400 );
}
}

View File

@ -293,8 +293,8 @@ class Taxonomy extends Metadata_Type {
$item = $item_metadata->get_item();
if ( !in_array($item->get_status(), apply_filters('tainacan-status-require-validation', ['publish','future','private'])) )
return true;
// if ( !in_array($item->get_status(), apply_filters('tainacan-status-require-validation', ['publish','future','private'])) )
// return true;
$valid = true;