WC_Product_Importer::get_percent_complete()publicWC 1.0

Get file pointer position as a percentage of file size.

{} Это метод класса: WC_Product_Importer{}

Хуков нет.

Возвращает

int.

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

$WC_Product_Importer = new WC_Product_Importer();
$WC_Product_Importer->get_percent_complete();

Код WC_Product_Importer::get_percent_complete() WC 6.9.4

public function get_percent_complete() {
	$size = filesize( $this->file );
	if ( ! $size ) {
		return 0;
	}

	return absint( min( NumberUtil::round( ( $this->file_position / $size ) * 100 ), 100 ) );
}