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,
		) );

	}


Top ↑

User Contributed Notes User Contributed Notes

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





Permalink: