Automattic\WooCommerce\Internal\CLI\Migrator\Lib

ImportSession::count_imported_entitiespublicWC 1.0

Gets the current progress information.

Method of the class: ImportSession{}

No Hooks.

Returns

Array. The progress data

Usage

$ImportSession = new ImportSession();
$ImportSession->count_imported_entities();

ImportSession::count_imported_entities() code WC 10.7.0

public function count_imported_entities() {
	$progress = array();
	foreach ( self::PROGRESS_ENTITIES as $entity ) {
		$progress[] = array(
			'label'    => $entity,
			'imported' => (int) get_post_meta( $this->post_id, 'imported_' . $entity, true ),
			'total'    => (int) get_post_meta( $this->post_id, 'total_' . $entity, true ),
		);
	}

	return $progress;
}