LLMS_Generator::get_stats()

Get “stats” about the generated content.


Return Return

(array)


Top ↑

Source Source

File: includes/class.llms.generator.php

281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
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.