Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter Bage

    (@bagerathan)

    Just to clarify, I am able to get the total number of tickets by a user, but not separately by “closed” or “awaiting reply.”

    Thanks again.

    Plugin Author julien731

    (@julien731)

    You can count the tickets by using the function get_tickets().

    The function takes 2 parameters:

    • $status: can be open or closed
    • $args: an array of arguments

    To get tickets with a specific state, use post_status in the $args array. Available states are: queued, processing, hold.

    The function returns an array of tickets if any or an empty array otherwise.

    Examples:

    Get all open tickets:

    $tickets = get_tickets( 'open' );

    Get all open tickets in progress:

    $tickets = get_tickets( 'open', array( 'post_status' => 'queued' ) );
    Thread Starter Bage

    (@bagerathan)

    Awesome. Thank you.

    Plugin Author julien731

    (@julien731)

    You’re welcome. Don’t forget to review the plugin if you’re satisfied ??

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Count tickets.’ is closed to new replies.