Skip to content

Instantly share code, notes, and snippets.

@webdados
Created February 26, 2019 13:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save webdados/98282475fbee2be347eba45ad81cbba5 to your computer and use it in GitHub Desktop.
Save webdados/98282475fbee2be347eba45ad81cbba5 to your computer and use it in GitHub Desktop.
Taxonomy/Term and Role based Discounts for WooCommerce actions
<?php
add_action( 'tdw_rule_add', function( $id_term, $taxonomy, $data ) {
//Do whatever you want with $id_term, $taxonomy and $data
}, 10, 3 );
add_action( 'tdw_rule_edit', function( $id_term, $taxonomy, $data, $old_data ) {
//Do whatever you want with $id_term, $taxonomy, $data and $old_data
}, 10, 4 );
add_action( 'tdw_rule_delete', function( $id_term, $taxonomy, $data ) {
//Do whatever you want with $id_term, $taxonomy and $data
}, 10, 3 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment