ActionScheduler_wpPostStore::filter_insert_post_data()publicWC 1.0

Filter insert post data.

Метод класса: ActionScheduler_wpPostStore{}

Хуков нет.

Возвращает

Массив.

Использование

$ActionScheduler_wpPostStore = new ActionScheduler_wpPostStore();
$ActionScheduler_wpPostStore->filter_insert_post_data( $postdata );
$postdata(массив) (обязательный)
Post data to filter.

Код ActionScheduler_wpPostStore::filter_insert_post_data() WC 8.7.0

public function filter_insert_post_data( $postdata ) {
	if ( self::POST_TYPE === $postdata['post_type'] ) {
		$postdata['post_author'] = 0;
		if ( 'future' === $postdata['post_status'] ) {
			$postdata['post_status'] = 'publish';
		}
	}
	return $postdata;
}