Automattic\WooCommerce\Internal\ProductFeed\Storage

JsonFileFeed::generate_file_name │ private │ WC 1.0

Generate the feed file name based on the base name and the current time.

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

Хуки из метода

Возвращает

string. The feed file name.

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

// private - только в коде основоного (родительского) класса
$result = $this->generate_file_name(): string;

Код JsonFileFeed::generate_file_name() WC 11.2.2

private function generate_file_name(): string {
	/**
	 * Allows the current time to be overridden before a feed is stored.
	 *
	 * @param int           $time The current time.
	 * @param FeedInterface $feed The feed instance.
	 * @return int The current time.
	 * @since 10.5.0
	 */
	$current_time = apply_filters( 'woocommerce_product_feed_time', time(), $this );
	$hash_data    = $this->base_name . gmdate( 'r', $current_time );

	return sprintf(
		'%s-%s-%s.json',
		$this->base_name,
		gmdate( 'Y-m-d', $current_time ),
		wp_hash( $hash_data )
	);
}