Menu Close Menu
Menu
  • 0
    • Number of items in basket: 0

      • Your basket is empty.
      • Total: £0.00
      • Checkout
  • Blog
  • Extensions
  • Support
    • Documentation
    • Log a Support Ticket
  • Your Account
    • Register
  • Contact Us
  • Demo

Creating Custom Ticket Statuses

Creating Custom Ticket Statuses

Create your own statuses to be assigned to tickets

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.

Share this:

  • Tweet
  • WhatsApp

Related Articles

Advanced Tickets Workflow Last updated: 5th March 2017

Published by Michael

Mike is the founder and lead developer of KB Support. When he's not working on KB Support, he's generally spending time with his 3 children and following his favourite football team

Posts by Michael Visit Website

Post navigation

Previous

Changing Ticket Status Labels

Next

Updating Premium Extensions

Article Categories

  • Configuration
    • Advanced
    • Getting Started
  • Developer Docs
    • Constants
    • Hooks
  • Extensions
  • FAQs

Latest Tweets

RT @nhsCFwarriormum: @ChrisMRiches -Love this Great to see @cftrust working with @Daily_Express to help raise valuable funds for this brill…

- 7 days ago

h J R
The Advanced Ticket Assignment Extension for KB Support is available now! - https://t.co/6bIm4FJgoN

- 47 days ago

h J R
Configuring Advanced Ticket Assignment https://t.co/Afs57XLn43 https://t.co/F5Afzlv9S0

- 47 days ago

h J R

Social Links

  • Follow us on Twitter
  • Like us on Facebook
  • Fork us on GitHub

Sign up to our newsletter!

Subscribe now to receive all the latest news, thoughts and offers from KB Support.
New subscribers will receive 15% off their first purchase.

Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Cookie Policy
© 2019 KB Support. All rights reserved.
  • Blog
  • Shop
  • Support
  • Donate
  • Your Account
  • Contact Us
  • Privacy Policy