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

      • Your cart is empty.
      • Total: $0.00
      • Checkout
  • Pricing
    • Purchase Options
    • Individual Extensions
  • Support
    • Documentation
    • Log a Support Ticket
  • Your Account
    • Register
  • Blog

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.

Advanced Hooks Tickets Workflow Last updated: 28/10/2017

Published by Cristian Raiber

Posts by Cristian Raiber

Post navigation

Previous

Working with Caching Plugins

Next

Creating Custom Ticket Statuses

Contact Details

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

Developer Resources

Plugin Boilerplate

Trello Board

GitHub Repository

Ratings & Satisfaction Docs

  • Configuring Ratings and Satisfaction
  • Advanced Settings

Email Support Docs

  • Plugin Requirements
  • Configuring Email Support
  • Creating New Tickets
  • Replying to Closed Tickets
  • Anonymous Replies in Email Support
  • HTML Emails Tags
  • Email Commands
  • Defining IMAP Flags

KBS REST API Docs

  • Using the REST API
  • Tickets REST API Route
  • Replies REST API Route
  • Articles REST API Route
  • Agents REST API Route
  • Customers REST API Route
  • Companies REST API Route
  • Forms REST API Route
  • Form Fields REST API Route
  • Ticket Categories REST API Route
  • Ticket Departments REST API Route
  • Ticket Source REST API Route

Article Categories

  • Configuration
    • Advanced
    • Getting Started
  • Developer Docs
    • Constants
    • Hooks
  • Extensions
  • FAQs
© 2023 KB Support. All rights reserved.
  • Blog
  • Shop
  • Support
  • Privacy Policy
  • Discount Code