LLMS_Generator::get_stats()

Get “stats” about the generated content.


Return Return

(array)


Top ↑

Source Source

File: includes/class.llms.generator.php

	public function get_stats() {

		$stats = array();
		foreach ( $this->generated as $type => $ids ) {
			$stats[ $type ] = count( $ids );
		}

		// Add old plural keys that were guaranteed to exist.
		$backwards_compat = array(
			'course'      => 'courses',
			'section'     => 'sections',
			'lesson'      => 'lessons',
			'access_plan' => 'plans',
			'quiz'        => 'quizzes',
			'question'    => 'questions',
			'term'        => 'terms',
			'user'        => 'authors',
		);
		foreach ( $backwards_compat as $curr => $old ) {
			$stats[ $old ] = isset( $stats[ $curr ] ) ? $stats[ $curr ] : 0;
		}

		return $stats;

	}


Top ↑

Changelog Changelog

Changelog
Version Description
4.7.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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