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

	 *                      @arg string $order    result order (DESC, ASC)
	 *                      @arg int    $skip     number of results to skip for pagination purposes
	 * @return array        "courses" will contain an array of course ids
	 *                      "more" will contain a boolean determining whether or not more courses are available beyond supplied limit/skip criteria
	 * @since   ??
	 * @version 3.24.0
	 */
	public function get_completed_courses( $args = array() ) {

		global $wpdb;

		$args = array_merge(
			array(
				'limit'   => 20,
				'orderby' => 'upm.updated_date',
				'order'   => 'DESC',
				'skip'    => 0,
			),
			$args
		);

		// Add one to the limit to see if there's pagination.
		$args['limit']++;

		// phpcs:disable WordPress.DB.PreparedSQL.InterpolatedNotPrepared
		$q = $wpdb->get_results(
			$wpdb->prepare(

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.