Hello,
I do not fully understand the difference between
$user_patreon_level and $user_patronage
$user_patreon_level = true or false if user is a Patreon or not
$user_patronage = numeric value of the tier (eg. 700 for $7)
correct?
I made a code snippet to limit the credits’ usage for another plugin depending on the Patreon tier, but the $user_patreon_level is missing in the below code.
Do I need it like this ?
$user_patreon_level = get_user_meta($user->ID, 'cb_p6_a1_patreon_level', true);
my snippet
add_filter( 'mwai_stats_credits', function ( $credits, $userId ) {
$user = get_userdata( $userId );
if ( is_user_logged_in() ) {
$user_patronage = Patreon_Wordpress::getUserPatronage();
$vip = get_user_meta( $user->ID, 'cb_p6_a1_vip_user', true );
if ( $user_patronage >= 2100 || $vip ) {
return 200;
} elseif ( $user_patronage >= 1100 ) {
return 100;
} elseif ( $user_patronage < 1100 ) {
return 10;
}
}
// This will be basically the default value set in the plugin settings
// for logged-in users.
return $credits;
}, 10, 2);
Thanks!