lifterlms_template_achievements_loop( $student = null, $limit = false, $columns = null )
Description Description
Source Source
File: includes/functions/llms.functions.templates.achievements.php
function lifterlms_template_achievements_loop( $student = null, $limit = false, $columns = null ) { // get the current student if none supplied if ( ! $student ) { $student = llms_get_student(); } // don't proceed without a student if ( ! $student ) { return; } $cols = $columns ? $columns : llms_get_achievement_loop_columns(); // get achievements $achievements = $student->get_achievements( 'updated_date', 'DESC', 'achievements' ); if ( $limit && $achievements ) { $achievements = array_slice( $achievements, 0, $limit ); if ( $limit < $cols && ! $columns ) { $cols = $limit; } } llms_get_template( 'achievements/loop.php', array( 'cols' => $cols, 'achievements' => $achievements, ) ); }
Expand full source code Collapse full source code View on GitHub
User Contributed Notes User Contributed Notes
Permalink: