LLMS_Student::get_certificates( string $orderby = 'updated_date', string $order = 'DESC', string $return = 'obj' )

Retrieve certificates that a user has earned


Parameters Parameters

$orderby

(string) (Optional) field to order the returned results by

Default value: 'updated_date'

$order

(string) (Optional) ordering method for returned results (ASC or DESC)

Default value: 'DESC'

$return

(string) (Optional) return type obj => array of objects from $wpdb->get_results certificates => array of LLMS_User_Certificate instances

Default value: 'obj'


Top ↑

Return Return

(array)


Top ↑

Source Source

File: includes/models/model.llms.student.php

			   AND upm.meta_key = '_is_complete'
			   AND upm.meta_value = 'yes'
			   AND upm.user_id = %d
			 ORDER BY {$args['orderby']} {$args['order']}
			 LIMIT %d, %d;
			",
				array(
					$this->get_id(),
					$args['skip'],
					$args['limit'],
				)
			),
			'OBJECT_K'
		); // db call ok; no-cache ok.
		// phpcs:enable WordPress.DB.PreparedSQL.InterpolatedNotPrepared

		$ids  = array_keys( $q );
		$more = false;

		// If we hit our limit we have too many results, pop the last one.
		if ( count( $ids ) === $args['limit'] ) {
			array_pop( $ids );
			$more = true;
		}

		// Reset args to pass back for pagination.
		$args['limit']--;

Top ↑

Changelog Changelog

Changelog
Version Description
2.4.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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