LLMS_Background_Updater::get_progress()
Retrieve approximate progress of updates in the queue
Contents
Return Return
(int)
Source Source
File: includes/class.llms.background.updater.php
public function get_progress() { // If the queue is empty we've already finished. if ( $this->is_queue_empty() ) { return 0; } // Get the progress. $batch = $this->get_batch(); $total = max( array_keys( $batch->data ) ) + 1; $remaining = count( $batch->data ); if ( ! $total ) { return 0; } return ceil( ( ( $total - $remaining ) / $total ) * 100 ); }
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
3.4.3 | |
3.16.10 | Introduced. |