Limits Question
-
add_filter( 'mwai_stats_credits', function ( $credits, $userId ) { $user = get_userdata( $userId ); if ( !empty( $user->roles) && is_array( $user->roles ) ) { foreach ( $user->roles as $role) { if ( $role === 'premium' ) { return 50; } if ( $role === 'standard' ) { return 10; } } } // This will be basically the default value set in the plugin settings // for logged-in users. return $credits; }, 10, 2);Regarding this code, if the roles I have are “subscriber” and “customer”, would I just replace the two in the example above with the roles on my site i.e. subscriber and customer? Can I enable “is absolute” with this code, too or do I just do that in the backend?
- This topic was modified 3 years, 3 months ago by .
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
The topic ‘Limits Question’ is closed to new replies.