Advertisement
designbymerovingi

Transfer Author Fix

Jul 19th, 2017
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.40 KB | None | 0 0
  1. // Temporary fix for recipient not found for author transfers
  2. function mycred_pro_transfer_id_fix( $recipient_id = false, $to = '' ) {
  3.  
  4.     if ( $recipient_id === false && is_numeric( $to ) ) {
  5.  
  6.         $user = get_userdata( $to );
  7.         if ( isset( $user->ID ) )
  8.             $recipient_id = $user->ID;
  9.  
  10.     }
  11.  
  12.     return $recipient_id;
  13.  
  14. }
  15. add_filter( 'mycred_transfer_get_recipient', 'mycred_pro_transfer_id_fix', 10, 2 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement