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 8.7.0

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

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