User Activity loop

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

Query arguments

  • activity_event - Whether to filter activities by "started" or "completed" date - values "started" and "completed"

    Default: started
    Type: string

  • 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"

    Default: day
    Type: string

  • 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

    Default: 25
    Type: number

  • 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

    Default: desc
    Type: string

  • 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