Wow. Just when I thought it couldn’t get any cooler. (Not to toot my own horn).
The next version of Quality Control (currently awaiting review) takes things to the next level. In reality there are very few new “features” for the average user. However, things have been cleaned up, and made ridiculously easy to use.
I’ve set it up now so each “module” of Quality Control is loaded through add_theme_support. This way, child themes can effortlessly remove built in features like milestones, categories, tags, assignment, and notifications. Not only is it easy to remove features, but it’s almost just as easy to add them. A new class has been introduced that handles creating new taxonomies automatically. It will automatically add it to the navigation, ticket meta, admin backend, ticket listing columns, save the information when publishing tickets, and add the fields to the form. It’s awesome. Here is how it is used:
In functions.php of your child theme add:
add_action( 'after_setup_theme', 'quality_child_test', 11 );
function quality_child_test() {
add_theme_support( 'ticket-priority' );
require_if_theme_supports( 'ticket-priority', locate_core_file( 'inc/modules/priorities.php' ) );
}
Then create a file in /inc/moddules/ called priorities.php (this is in the child theme directory)
<?php
/**
* @package Quality_Control
* @subpackage Ticket Taxonomies
* @since Quality Control 0.2
*/
if ( ! class_exists( 'quality_ticket_priority' ) ) :
/**
* Create the status taxonomy. Nothing custom here.
*
* @since Quality Control 0.2
*/
class quality_ticket_priority extends quality_create_taxonomy
{
/**
* Just create the name, slug, and labels. The rest is
* done automagically.
*
* @since Quality Control 0.2
*/
function quality_ticket_priority() {
parent::quality_create_taxonomy(
'ticket_priority',
'priority',
array(
'name' => __( 'Priorities', 'quality' ),
'singular_name' => __( 'Priority', 'quality' ),
'search_items' => __( 'Search Priorities', 'quality' ),
'popular_items' => __( 'Popular Priorities', 'quality' ),
'all_items' => __( 'All Priorities', 'quality' ),
'update_item' => __( 'Update Priority', 'quality' ),
'add_new_item' => __( 'Add New Priority', 'quality' ),
'new_item_name' => __( 'New Priority Name', 'quality' ),
'edit_item' => __( 'Edit Priority', 'quality' )
)
);
$this->actions();
}
}
endif;
$ticket_priority = new quality_ticket_priority;
This will automatically add a new taxonomy called “Priority”. Amazing.