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.
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' ) );
You’re welcome. Don’t forget to review the plugin if you’re satisfied 🙂