Skip to content

Instantly share code, notes, and snippets.

@greenhornet79
Last active November 17, 2015 14:20
Show Gist options
  • Save greenhornet79/14bf72e7f80cd082e04c to your computer and use it in GitHub Desktop.
Save greenhornet79/14bf72e7f80cd082e04c to your computer and use it in GitHub Desktop.
Show custom benefits for a subscription card on the subscribe page in Leaky Paywall
<?php
add_filter( 'leaky_paywall_subscription_options_allowed_content', 'zeen101_show_level_benefits_on_card', 10, 3 );
function zeen101_show_level_benefits_on_card( $allowed_content, $level_id, $level ) {
switch ( $level_id ) {
case 0:
$output = '<ul>';
$output .= '<li>Gold Benfit #1</li>';
$output .= '<li>Gold Benefit #2</li>';
$output .= '<li>Gold Benefit #3</li>';
$output .= '</ul>';
break;
case 1:
$output = '<ul>';
$output .= '<li>Platinum Benfit #1</li>';
$output .= '<li>Platinum Benefit #2</li>';
$output .= '<li>Platinum Benefit #3</li>';
$output .= '</ul>';
break;
default:
$output = $allowed_content;
break;
}
return $output;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment