Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_filter( 'mycred_video_output', 'mycred_limit_video_views', 10, 2 );
- function mycred_limit_video_views( $output, $atts ) {
- global $wpdb;
- $mycred = mycred();
- $count = $wpdb->get_var( "SELECT COUNT( * ) FROM {$mycred->log_table} WHERE ref = 'watching_video' AND data = %s;", $atts['id'] );
- $limit = 100;
- if ( $count >= $limit )
- return '';
- return $output;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement