Tribe__Events__Aggregator__Tabs__Edit::handle_submit()
Source
File: src/Tribe/Aggregator/Tabs/Edit.php
public function handle_submit() {
$this->messages = array(
'error',
'success',
'warning',
);
if ( empty( $_POST['aggregator']['action'] ) || 'edit' !== $_POST['aggregator']['action'] ) {
return;
}
$submission = parent::handle_submit();
if ( empty( $submission['record'] ) || empty( $submission['post_data'] ) || empty( $submission['meta'] ) ) {
return;
}
$record = $submission['record'];
$post_data = $submission['post_data'];
$meta = $submission['meta'];
if ( ! empty( $post_data['post_id'] ) ) {
$this->finalize_schedule_edit( $record, $post_data, $meta );
return;
} else {
$post = $record->create( $meta['type'], array(), $meta );
if ( is_wp_error( $post ) ) {
return $post;
}
$result = $record->queue_import();
}
if ( is_wp_error( $post ) ) {
return $post;
}
return $result;
}