| @@ -82,8 +82,19 @@ | ||
| 82 | 82 | // True if lifetime value matches condition |
| 83 | 83 | $return = (bool) ( gamipress_number_condition_matches( $lifetime, $required_value, $condition ) ); |
| 84 | 84 | } |
| 85 | 85 | |
| 86 | + // Subscription months active | |
| 87 | + if( $trigger === 'gamipress_wc_subscription_months_active' || $trigger === 'gamipress_wc_specific_subscription_months_active' ) { | |
| 88 | + | |
| 89 | + $months_old = absint( $args[3] ); | |
| 90 | + | |
| 91 | + $required_months_old = absint( gamipress_get_post_meta( $requirement_id, '_gamipress_wc_subscription_months', true ) ); | |
| 92 | + | |
| 93 | + // True if there is months old is equal to required months old | |
| 94 | + $return = (bool) ( $months_old >= $required_months_old ); | |
| 95 | + } | |
| 96 | + | |
| 86 | 97 | return $return; |
| 87 | 98 | |
| 88 | 99 | } |
| 89 | 100 | |