By default, you can set expiry dates a specific period of time into the future. So a membership role will expire one month, one year, etc from the time of purchase.
If you’d prefer to set a specific date, you’d need to use the following filter:
This file contains 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 | |
/** | |
* Set fixed expiry date | |
*/ | |
function prefix_role_expiration_date( $expires, $role, $user_id ) { | |
$expires = '25 October 2020'; | |
return strtotime( $expires ); | |
} | |
add_filter( 'wcmo_role_expiration_date', 'prefix_role_expiration_date', 10, 3 ); |
Here’s how to add a snippet.