Alert: This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.
LLMS_Privacy_Exporters::get_enrollment_data( int $post_id, obj $student, obj $post_type_object )
Get an array of enrollment data for a course or membership
Parameters Parameters
- $post_id
-
(int) (Required) WP Post ID of course or membership.
- $student
-
(obj) (Required) LLMS_Student.
- $post_type_object
-
(obj) (Required) WP post type object.
Return Return
(array)
Source Source
File: includes/privacy/class-llms-privacy-exporters.php
187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 | private static function get_enrollment_data( $post_id , $student , $post_type_object ) { $data = array (); $data [] = array ( // Translators: %s = post type singular name label (Course or Membership). 'name' => sprintf( __( '%s Title' , 'lifterlms' ), $post_type_object ->labels->singular_name ), 'value' => get_the_title( $post_id ), ); $data [] = array ( 'name' => __( 'Enrollment Status' , 'lifterlms' ), 'value' => llms_get_enrollment_status_name( $student ->get_enrollment_status( $post_id ) ), ); $data [] = array ( 'name' => __( 'Enrollment Date' , 'lifterlms' ), 'value' => $student ->get_enrollment_date( $post_id , 'enrolled' , 'Y-m-d H:i:s' ), ); if ( 'course' === $post_type_object ->name ) { $data [] = array ( 'name' => __( 'Last Activity' , 'lifterlms' ), 'value' => $student ->get_enrollment_date( $post_id , 'updated' , 'Y-m-d H:i:s' ), ); $progress = $student ->get_progress( $post_id , 'course' ); if ( is_numeric ( $progress ) ) { $progress .= '%' ; } $data [] = array ( 'name' => __( 'Progress' , 'lifterlms' ), 'value' => $progress , ); $grade = $student ->get_grade( $post_id ); if ( is_numeric ( $grade ) ) { $grade .= '%' ; } $data [] = array ( 'name' => __( 'Grade' , 'lifterlms' ), 'value' => $grade , ); } return apply_filters( 'llms_privacy_export_enrollment_data' , $data , $post_id , $student , $post_type_object ); } |
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
3.30.3 | Fixed spelling errors. |
3.18.0 | Introduced. |