Automattic\WooCommerce\Internal\ProductFeed\Storage

JsonFileFeed::get_file_url_for_identifier │ public static │ WC 11.2.0

Builds the current URL for a feed identifier.

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

Хуков нет.

Возвращает

string|null. The feed URL, or null if the identifier is invalid.

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

$result = JsonFileFeed::get_file_url_for_identifier( $identifier ): ?string;
$identifier(строка) (обязательный)
The feed file identifier.

Список изменений

С версии 11.2.0 Введена.

Код JsonFileFeed::get_file_url_for_identifier() WC 11.2.2

public static function get_file_url_for_identifier( string $identifier ): ?string {
	if ( ! self::is_valid_feed_identifier( $identifier ) ) {
		return null;
	}

	$upload_dir    = wp_upload_dir( null, false, true );
	$directory_url = self::build_directory_url( untrailingslashit( $upload_dir['baseurl'] ) );
	return self::build_file_url( $directory_url, rawurlencode( $identifier ) );
}