Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function my_edd_grandfather_renewal_discount( $renewal_discount, $license_id ) {
- if ( ! $license_id ) {
- return $renewal_discount;
- }
- $license = edd_software_licensing()->get_license( $license_id );
- if ( ! is_object( $license ) ) {
- return $renewal_discount;
- }
- if( ! empty( $license->date_created ) && strtotime( $license->date_created ) < strtotime( 'April 1, 2018' ) ) {
- if ( $license->is_expired() ) {
- $renewal_discount = 20;
- } else {
- $renewal_discount = 30;
- }
- }
- return $renewal_discount;
- }
- add_filter( 'edd_sl_renewal_discount_percentage', 'my_edd_grandfather_renewal_discount', 10, 2 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement