Skip to content

Instantly share code, notes, and snippets.

@greenhornet79
Created April 19, 2024 18:50
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 greenhornet79/b478bebb54fdf1077520584ef8ac4e3b to your computer and use it in GitHub Desktop.
Save greenhornet79/b478bebb54fdf1077520584ef8ac4e3b to your computer and use it in GitHub Desktop.
<?php
add_filter('leaky_paywall_block_active_sub_to_group', 'endo_add_active_sub_to_group', 10, 2 );
function endo_add_active_sub_to_group($block_active_sub_to_group, $user) {
$level_id = leaky_paywall_subscriber_current_level_id( $user );
if ( !is_numeric( $level_id ) ) {
return $block_active_sub_to_group;
}
$level = get_leaky_paywall_subscription_level( $level_id );
if ( $level['price'] > 0 ) {
return $block_active_sub_to_group;
}
return false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment