Automattic\WooCommerce\Internal\ProductFeed\Storage

JsonFileFeed::feed_file_path │ private │ WC 1.0

Resolves a feed file's path from its identifier without creating the upload directory.

Unlike {@see get_upload_dir()} (used when writing), this must not create the directory as a side effect. Callers must validate the identifier with {@see is_valid_feed_identifier()} first.

Method of the class: JsonFileFeed{}

No Hooks.

Returns

string. The absolute path to the feed file.

Usage

// private - for code of main (parent) class only
$result = $this->feed_file_path( $identifier ): string;
$identifier(string) (required)
The feed file name.

JsonFileFeed::feed_file_path() code WC 11.1.2

private function feed_file_path( string $identifier ): string {
	$upload_dir = wp_upload_dir( null, false );
	return $upload_dir['basedir'] . DIRECTORY_SEPARATOR . self::UPLOAD_DIR . DIRECTORY_SEPARATOR . $identifier;
}