LLMS_Controller_Awards::on_earn( int $user_id, int $post_id )

Records a timestamp when the award is earned.


Parameters Parameters

$user_id

(int) (Required) WP_User ID of the user who earned the certificate.

$post_id

(int) (Required) WP_Post ID of the certificate post.


Top ↑

Return Return

(boolean|string) Returns false if the certificate could not be loaded, otherwise returns the current timestamp in MySQL format.


Top ↑

Source Source

File: includes/controllers/class-llms-controller-awards.php

	public static function on_earn( $user_id, $post_id ) {

		$obj = self::get_object( $post_id );
		if ( ! $obj ) {
			return false;
		}

		$ts = llms_current_time( 'mysql' );
		$obj->set( 'awarded', $ts );

		return $ts;

	}


Top ↑

Changelog Changelog

Changelog
Version Description
6.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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