WC_Product::has_file()publicWC 1.6.2

Check if downloadable product has a file attached.

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

Хуков нет.

Возвращает

true|false. Whether downloadable product has a file attached.

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

$WC_Product = new WC_Product();
$WC_Product->has_file( $download_id );
$download_id(строка)
file identifier.
По умолчанию: ''

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

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

Код WC_Product::has_file() WC 8.7.0

public function has_file( $download_id = '' ) {
	return $this->is_downloadable() && $this->get_file( $download_id );
}