Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * View Content Hook Adjustment
- * Force the View Content hook to only award points once per post.
- * @version 1.1.2
- */
- add_filter( 'mycred_add', 'mycred_pro_view_once_per_post', 10, 3 );
- function mycred_pro_view_once_per_post( $reply, $request, $mycred ) {
- if ( ! in_array( $request['ref'], array( 'view_content', 'view_content_author' ) ) || $reply === false ) return $reply;
- extract( $request );
- if ( $mycred->has_entry( $ref, $ref_id, $user_id, $data, $type ) )
- return false;
- return $reply;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement