Alert: This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.

LLMS_Update::output_progress_notice( array $progress )

Output a LifterLMS Admin Notice displaying the progress of the background updates


Parameters Parameters

$progress

(array) (Required) progress array from $this->get_progress()


Top ↑

Return Return

(void)


Top ↑

Source Source

File: includes/abstracts/abstract.llms.update.php

	private function output_progress_notice( $progress ) {

		$id = 'llms_db_update_notice_' . $this->version;

		if ( LLMS_Admin_Notices::has_notice( $id ) ) {
			LLMS_Admin_Notices::delete_notice( $id );
		}

		$vals  = array_count_values( $progress['functions'] );
		$val   = isset( $vals['done'] ) ? $vals['done'] : 0;
		$max   = count( $progress['functions'] );
		$width = $val ? ( $val / $max ) * 100 : 0;
		$html  = '
			<p>' . sprintf( __( 'LifterLMS Database Upgrade %s Progress Report', 'lifterlms' ), $this->version ) . '</p>
			<div style="background:#efefef;height:18px;margin:0.5em 0;"><div style="background:#ef476f;display:block;height:18px;width:' . $width . '%;"><span style="padding:0 0.5em;color:#fff;">' . $width . '%</span></div></div>
			<p><em>' . sprintf( __( 'This completion percentage is an estimate, please be patient and %1$sclick here%2$s for more information.', 'lifterlms' ), '<a href="https://lifterlms.com/docs/lifterlms-database-updates/#upgrade-progress-report" target="_blank">', '</a>' ) . '</em></p>
		';

		LLMS_Admin_Notices::add_notice(
			$id,
			array(
				'dismissible' => false,
				'flash'       => true,
				'html'        => $html,
				'type'        => 'info',
			)
		);

	}


Top ↑

Changelog Changelog

Changelog
Version Description
3.3.1 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.