lifterlms_template_student_dashboard_my_certificates( bool $preview = false )

Template for My Certificates on dashboard


Parameters Parameters

$preview

(bool) (Optional) If true, outputs a short list of certificates to display on the dashboard landing page. Otherwise displays all of the earned certificates for display on the view-certificates endpoint.

Default value: false


Top ↑

Return Return

(void)


Top ↑

Source Source

File: includes/functions/llms.functions.templates.dashboard.php

	function lifterlms_template_student_dashboard_my_certificates( $preview = false ) {

		$student = llms_get_student();
		if ( ! $student ) {
			return;
		}

		$enabled = LLMS_Student_Dashboard::is_endpoint_enabled( 'view-certificates' );
		if ( ! $enabled ) {
			return;
		}

		$more = false;
		if ( $preview ) {
			$more = array(
				'url'  => llms_get_endpoint_url( 'view-certificates', '', llms_get_page_url( 'myaccount' ) ),
				'text' => __( 'View All My Certificates', 'lifterlms' ),
			);
		}

		ob_start();
		lifterlms_template_certificates_loop( $student, $preview ? llms_get_certificates_loop_columns() : false );

		llms_get_template(
			'myaccount/dashboard-section.php',
			array(
				'action'  => 'my_certificates',
				'slug'    => 'llms-my-certificates',
				'title'   => $preview ? __( 'My Certificates', 'lifterlms' ) : '',
				'content' => ob_get_clean(),
				'more'    => $more,
			)
		);

	}


Top ↑

Changelog Changelog

Changelog
Version Description
6.0.0 Output short list when $preview is true. Don't output any HTML when the endpoint is disabled.
3.19.0 Unknown
3.14.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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