LLMS_Admin_Reporting::output_event( LLMS_User_Postmeta $event, string $context = 'course' )
Output the HTML for a postmeta event in the recent events sidebar of various reporting screens.
Parameters Parameters
- $event
-
( )(Required) Instance of an LLMS_User_Postmeta item.
- $context
-
(string) (Optional) Display context [course|student|quiz|membership]. Default 'course'.
Default value: 'course'
Return Return
(void)
Source Source
File: includes/admin/reporting/class.llms.admin.reporting.php
/** * Output the HTML for a postmeta event in the recent events sidebar of various reporting screens. * * @since 3.15.0 * @since 3.32.0 Outputs the student's avatar when in 'membership' context. * * @param LLMS_User_Postmeta $event Instance of an LLMS_User_Postmeta item. * @param string $context Optional. Display context [course|student|quiz|membership]. Default 'course'. * @return void */ public static function output_event( $event, $context = 'course' ) { $student = $event->get_student(); if ( ! $student ) { return; } $url = $event->get_link( $context ); ?> <div class="llms-reporting-event <?php echo $event->get( 'meta_key' ); ?> <?php echo $event->get( 'meta_value' ); ?>"> <?php if ( $url ) : ?> <a href="<?php echo esc_url( $url ); ?>"> <?php endif; ?> <?php if ( 'course' === $context || 'membership' === $context || 'quiz' === $context ) : ?> <?php echo $student->get_avatar( 24 ); ?> <?php endif; ?>
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
3.32.0 | Outputs the student's avatar when in 'membership' context. |
3.15.0 | Introduced. |