Automattic\WooCommerce\Internal\ProductFeed\Integrations\POSCatalog
AsyncGenerator::discard_feed
Deletes the feed file referenced by a status, if any.
Completed feeds expose a full path; in-progress chunked feeds only track a file name.
Метод класса: AsyncGenerator{}
Хуков нет.
Возвращает
void. Ничего (null).
Использование
// private - только в коде основоного (родительского) класса $result = $this->discard_feed( $status ): void;
- $status(массив) (обязательный)
- The feed generation status.
Код AsyncGenerator::discard_feed() AsyncGenerator::discard feed WC 11.2.2
private function discard_feed( array $status ): void {
// A completed feed exposes a full path; an in-progress chunked feed only tracks a file name.
// Reduce either to a plain identifier and let ResumableFeedInterface::delete() validate it and confine
// the deletion to the feed directory, so a tampered path read back from the option can never escape it.
$identifier = ! empty( $status['file_name'] )
? (string) $status['file_name']
: ( ! empty( $status['path'] ) ? wp_basename( (string) $status['path'] ) : '' );
if ( '' !== $identifier ) {
$this->integration->create_feed()->delete( $identifier );
}
}