feat: add filter `tainacan-submission-item-data`

This commit is contained in:
vnmedeiros 2021-09-29 16:19:09 -03:00
parent 930649c09c
commit 7b11899082
1 changed files with 4 additions and 0 deletions

View File

@ -972,6 +972,10 @@ class REST_Items_Controller extends REST_Controller {
try {
$item['status'] = 'auto-draft';
$item = $this->prepare_item_for_database( [ $item, $collection_id ] );
$data = apply_filters('tainacan-submission-item-data', $item, $metadata);
if ( \is_null($data) === false ) {
$item = $data;
}
if ( $item->validate() ) {
$item = $this->items_repository->insert( $item );