WC_Customer_Download::get_download_count
Get download_count.
Метод класса: WC_Customer_Download{}
Хуков нет.
Возвращает
Int.
Использование
$WC_Customer_Download = new WC_Customer_Download(); $WC_Customer_Download->get_download_count( $context );
- $context(строка)
- What the value is for. Valid values are
'view'and'edit'.
По умолчанию:'view'
Код WC_Customer_Download::get_download_count() WC Customer Download::get download count WC 10.7.0
public function get_download_count( $context = 'view' ) {
// Check for count of download logs.
$data_store = WC_Data_Store::load( 'customer-download-log' );
$download_log_count = $data_store->get_download_logs_count_for_permission( $this->get_id() );
// Check download count in prop.
$download_count_prop = $this->get_prop( 'download_count', $context );
// Return the larger of the two in case they differ.
// If logs are removed for some reason, we should still respect the
// count stored in the prop.
return max( $download_log_count, $download_count_prop );
}