Skip to main content

User Activity

For loop type learndash_user_activity, here are the query parameters and fields.

Query parameters

  • activity_event - Whether to filter activities by "started" or "completed" date - values "started" and "completed"
    Type: string - Default: started

  • activity_status - Whether to filter activities by status - values "open", "started" and "completed"
    Type: string

  • course_id - Course ID or "current" of the activity
    Type: string

  • date_precision - When set to "full" takes into account hours,minutes and seconds when calculating date - values "full" and "day"
    Type: string - Default: day

  • from_date - Activities on and after a specific date. Accepts time format strings, eg. "Thursday, September 10, 2020 17:29:14", "2020-12-11" etc.
    Type: string

  • limit - Limit number of activities
    Type: number - Default: 25

  • on_date - Activities on a specific date. Accepts time format strings, eg. "Thursday, September 10, 2020 17:29:14", "2020-12-11" etc. Takes precedence over other date query arguments
    Type: string

  • order - Order - values: asc/desc
    Type: string - Default: desc

  • orderby - Order by - values: activity_id, user_id, post_id, course_id, activity_type, activity_status, activity_started, activity_completed, activity_updated
    Type: string

  • to_date - Activities to and on a specific date. Accepts time format strings, eg. "Thursday, September 10, 2020 17:29:14", "2020-12-11" etc.
    Type: string

  • user_id - User ID (current by default)
    Type: number

Fields

  • activity_id - Activity ID

  • activity_type - Activity type: course, lesson, topic, quiz

  • completed - Activity completed timestamp

  • course_id - Activity Course ID

  • duration - Duration in seconds (quiz only)

  • duration_in_minutes - Duration in minutes (quiz only)

  • id - Post ID

  • percentage - Progress percentage (0~100)

  • post - Post loop

  • started - Activity started timestamp

  • status - Status - One of: open, started, completed

  • steps_completed - Steps completed

  • steps_total - Total steps

  • title - Post title

  • type - Post loop type

  • url - Post URL