Fix broken counting of orders inside order project
This commit is contained in:
@@ -31,11 +31,23 @@ class Wiaas_Order_Project {
|
||||
'show_admin_column' => true,
|
||||
'query_var' => true,
|
||||
'rewrite' => array( 'slug' => 'shop_order_project' ),
|
||||
'update_count_callback' => array(__CLASS__, 'update_count_callback')
|
||||
);
|
||||
|
||||
register_taxonomy( 'shop_order_project', array( 'shop_order' ), $args );
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback to handle counting of number of orders inside every project
|
||||
* This does not work out of the box for orders since they are marked as private post type
|
||||
*
|
||||
* @param array $project_ids
|
||||
*/
|
||||
public static function update_count_callback($project_ids) {
|
||||
// Update counts
|
||||
_update_generic_term_count( $project_ids, get_taxonomy('shop_order_project') );
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves available order projects
|
||||
* @return array List of available order projects
|
||||
|
||||
Reference in New Issue
Block a user