lifterlms_template_student_dashboard_my_achievements( bool $preview = false )
Template for My Achievements on dashboard
Parameters Parameters
- $preview
-
(bool) (Optional) If
true, outputs a short list of achievements to display on the dashboard landing page. Otherwise displays all of the earned achievements for display on the view-achievements endpoint.Default value: false
Return Return
(void)
Source Source
File: includes/functions/llms.functions.templates.dashboard.php
function lifterlms_template_student_dashboard_my_achievements( $preview = false ) {
$student = llms_get_student();
if ( ! $student ) {
return;
}
$enabled = LLMS_Student_Dashboard::is_endpoint_enabled( 'view-achievements' );
if ( ! $enabled ) {
return;
}
$more = false;
if ( $preview ) {
$more = array(
'url' => llms_get_endpoint_url( 'view-achievements', '', llms_get_page_url( 'myaccount' ) ),
'text' => __( 'View All My Achievements', 'lifterlms' ),
);
}
ob_start();
lifterlms_template_achievements_loop( $student, $preview ? llms_get_achievement_loop_columns() : false );
llms_get_template(
'myaccount/dashboard-section.php',
array(
'action' => 'my_achievements',
'slug' => 'llms-my-achievements',
'title' => $preview ? __( 'My Achievements', 'lifterlms' ) : '',
'content' => ob_get_clean(),
'more' => $more,
)
);
}
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
| Version | Description |
|---|---|
| 6.0.0 | Don't output HTML when the endpoint is disabled. |
| 3.19.0 | Unknown. |
| 3.14.0 | Introduced. |