Changing Ticket Status Labels
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?
Changing Ticket Status Labels
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,…
KB Article rating:
4.0
based on 1 ratings