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

Changing Ticket Status Labels

Changing Ticket Status Labels

Customise the status labels associated with tickets

If the default ticket status labels from KB Support do not match your preferred names, you can change them with some simple lines of code.

The default status labels are New, Open, On Hold, and Closed. Each can be changed by hooking into the relevant filter:

  • New – kbs_register_post_status_new
  • Open – kbs_register_post_status_open
  • On Hold – kbs_register_post_status_hold
  • Closed – kbs_register_post_status_closed

By hooking into these filters, you are changing the $args parameter which is eventually passed to the WordPress function register_post_status().

Example

The following function will change the label for Open tickets to Active…

/**
 * Change the ticket 'Open' status label to 'Active'
 *
 * @param	array	$args	see $args param for register_post_status()
 * @return	array	Filtered $args
 */
function kbs_example_change_open_to_active( $args )	{
	// Sets the label for the status
	$args['label'] = sprintf( _x( 'Active', 'Active %s', 'kb-support' ), kbs_get_ticket_label_plural() );

	// Sets the label for the view when listing tickets. i.e. Active (10)
	$args['label_count'] = _n_noop( 'Active <span class="count">(%s)</span>', 'Active <span class="count">(%s)</span>', 'kb-support' );

	return $args;

}
add_filter( 'kbs_register_post_status_open', 'kbs_example_change_open_to_active' );

 


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

Related Articles

Advanced Hooks Tickets Workflow Last updated: 28th October 2017

Published by Mike

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 wife and 3 children (don't forget the dog) and following his favourite football team

Posts by Mike Visit Website

Post navigation

Previous

Working with Caching Plugins

Next

Creating Custom Ticket Statuses

Article Categories

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

Latest Tweets

Check out the new free plugin from our lead developer. Synchronized Post Publisher allows you to group posts (of an… https://t.co/uEmSWkT1dg

- 3 days ago

h J R
The KB Support #WordPress ticket system and knowledge base plugin is quite possibly the most feature-rich and exten… https://t.co/JSdBfYUY0b

- 26 days ago

h J R
WooCommerce Integration for KB Support has arrived! - https://t.co/qkhUWHcwC1

- 31 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.

© 2018 KB Support. All rights reserved.
  • Blog
  • Shop
  • Support
  • Donate
  • Your Account
  • Contact Us