Created
May 12, 2013 08:14
-
-
Save michael-cannon/5562825 to your computer and use it in GitHub Desktop.
Work around for Easy Digital Downloads Payment History report for showing account username than guest after using EDD Guest Registration to convert a guest account to real.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function dc_edd_get_payment_meta( $meta, $payment_id ) { | |
if ( -1 == $meta['user_id'] ) { | |
$user_id = get_post_meta( $payment_id, '_edd_payment_user_id', true ); | |
$meta['user_id'] = $user_id; | |
$user_info = maybe_unserialize( $meta['user_info'] ); | |
$user_info['id'] = $user_id; | |
$meta['user_info'] = serialize( $user_info ); | |
} | |
return $meta; | |
} | |
add_filter( 'edd_get_payment_meta', 'dc_edd_get_payment_meta', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment