Sometimes the four statuses that are included within KB Support core are not enough to support your workflow and you need to add more.
If this applies to you, you can purchase the Custom Ticket Status extension which provides an easy to use GUI interface to add your statuses as well as enabling actions to be taken when a ticket is placed into the custom status.
Alternatively, if you are a coder and would prefer to programmatically add custom statuses yourself without additional actions, read on.
Adding your Custom Status
In order to add your custom status and be able to assign tickets to the new status, you need to hook into the WordPress init
action and call the register_post_status()
function…
/** * Add the 'Parked' status for tickets * * @return void */ function kbs_example_add_custom_ticket_status() { $status = 'parked'; // Should be lower case $args = array( 'label' => __( 'Parked', 'text-domain' ), 'public' => true, 'exclude_from_search' => false, 'show_in_admin_all_list' => true, 'show_in_admin_status_list' => true, 'label_count' => _n_noop( 'Parked <span class="count">(%s)</span>', 'Parked <span class="count">(%s)</span>', 'text-domain' ), 'kb-support' => true, // This tells KBS that it is a ticket status 'kbs_select_allowed' => true // Needs to be true for the status to be selectable when editing tickets ); register_post_status( $status, $args ); } add_action( 'init', 'kbs_example_add_custom_ticket_status' );
If the kbs_select_allowed
argument is set to false, the new status cannot be selected when editing a ticket and the only way to assign the new status to a ticket is programmatically. For example, during a custom scheduled cron task.
Was this article helpful?
We're working hard to ensure we provide you with useful and relevant documentation to help you get the most out of KB Support.
Please take a moment to let us know if you found this article helpful.