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'


Top ↑

Return Return

(void)


Top ↑

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; ?>



Top ↑

Changelog Changelog

Changelog
Version Description
3.32.0 Outputs the student's avatar when in 'membership' context.
3.15.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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