LLMS_Admin_Users_Table::get_enrollments_column_output( LLMS_Student $student )

Retrieves the output for the “enrollments” column.


Parameters Parameters

$student

(LLMS_Student) (Required) Student object.


Top ↑

Return Return

(string)


Top ↑

Source Source

File: includes/admin/class-llms-admin-users-table.php

	protected function get_enrollments_column_output( $student ) {

		$info = array();

		$types = array(
			'courses'     => __( 'Courses', 'lifterlms' ),
			'memberships' => __( 'Memberships', 'lifterlms' ),
		);

		foreach ( $types as $type => $name ) {

			$url = LLMS_Admin_Reporting::get_current_tab_url(
				array(
					'stab'       => $type,
					'student_id' => $student->get_id(),
				)
			);

			$query = call_user_func( array( $student, 'get_' . $type ), array( 'limit' => 1 ) );

			$info[] = sprintf( '%1$s: <a href="%2$s">%3$d</a>', $name, esc_url( $url ), $query['found'] );

		}

		return implode( '<br>', $info );

	}


Top ↑

Changelog Changelog

Changelog
Version Description
4.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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