Created
June 9, 2025 12:39
-
-
Save plugin-republic/d9a1b8ca0c2a6452984e9f61c0474157 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Filter BXGY rule by brand taxonomy instead of category | |
| */ | |
| function demo_bxgy_taxonomy( $taxonomy, $rule, $rule_id ) { | |
| $taxonomy = 'product_brand'; // Change this to the taxonomy or tag of your choice | |
| return $taxonomy; | |
| } | |
| add_filter( 'wcfad_validate_bxgy_rule_taxonomy', 'demo_bxgy_taxonomy', 10, 3 ); | |
| function demo_bxgy_buy_categories( $buy_categories, $rule, $rule_id ) { | |
| $buy_categories = array( 34 ); // This is the taxonomy term ID | |
| return $buy_categories; | |
| } | |
| add_filter( 'wcfad_validate_bxgy_rule_buy_categories', 'demo_bxgy_buy_categories', 10, 3 ); | |
| function demo_bxgy_get_categories( $get_categories, $rule, $rule_id ) { | |
| $get_categories = array( 33 ); // This is the taxonomy term ID | |
| return $get_categories; | |
| } | |
| add_filter( 'wcfad_validate_bxgy_rule_get_categories', 'demo_bxgy_get_categories', 10, 3 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment