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.
Return Return
(boolean|string) Returns false if the certificate could not be loaded, otherwise returns the current timestamp in MySQL format.
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;
}
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
| Version | Description |
|---|---|
| 6.0.0 | Introduced. |