Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?php
add_filter( 'leaky_paywall_level_id_for_simplecirc_subscriber', 'zeen_set_level_id_by_price', 20, 2 );
function zeen_set_level_id_by_price( $level_id, $subscriber ) {
if ( !isset( $subscriber->subscriptions[0]->last_order->amount_paid ) ) {
return 1;
}
switch ($subscriber->subscriptions[0]->last_order->amount_paid) {
case 0.00:
$level_id = 1;
break;
case 16.95:
$level_id = 2;
break;
case 26.95:
$level_id = 3;
break;
case 36.95:
$level_id = 4;
break;
default:
$level_id = 5;
break;
}
return $level_id;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment