Skip to content

Instantly share code, notes, and snippets.

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 thomasplevy/d5b74f9c7781d767b98a09ef06e7f9fb to your computer and use it in GitHub Desktop.
Save thomasplevy/d5b74f9c7781d767b98a09ef06e7f9fb to your computer and use it in GitHub Desktop.
<?php // dont copy this line to your functions.php file
/**
* Customize which order statuses student can resubscribe from
* @param array $statuses array of order statuses
* default statuses: [ 'llms-pending-cancel', 'llms-pending', 'llms-on-hold' ]
* @return array
*/
function my_llms_order_status_can_resubscribe_from( $statuses ) {
unset( $statuses['llms-pending-cancel'] ); // this would make it so "Pending Cancellation" orders cannot be resubscribed from
$statuses[] = 'llms-failed'; // this allows "Failed" orders to be resubscribed to
return $statuses;
}
add_filter( 'llms_order_status_can_resubscribe_from', 'my_llms_order_status_can_resubscribe_from' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment