Added two do_actions to wc_reorder_terms

This commit is contained in:
Lars Støttrup Nielsen 2017-02-25 16:13:16 +01:00
parent 7829ec297a
commit 18c74817fc
1 changed files with 10 additions and 0 deletions

View File

@ -395,11 +395,21 @@ function wc_reorder_terms( $the_term, $next_id, $taxonomy, $index = 0, $terms =
// set order
$index++;
$index = wc_set_term_order( $term->term_id, $index, $taxonomy );
/**
* After a term has had it's order set.
*/
do_action( 'woocommerce_set_term_order', $term, $index, $taxonomy );
// if that term has children we walk through them
$children = get_terms( $taxonomy, "parent={$term->term_id}&menu_order=ASC&hide_empty=0" );
if ( ! empty( $children ) ) {
$index = wc_reorder_terms( $the_term, $next_id, $taxonomy, $index, $children );
/**
* After a term has had its children reordered.
*/
do_action( 'woocommerce_reorder_terms', $the_term, $next_id, $taxonomy, $index, $children );
}
}