Skip to content

Instantly share code, notes, and snippets.

@michael-cannon
Created May 12, 2013 08:14
Show Gist options
  • Save michael-cannon/5562825 to your computer and use it in GitHub Desktop.
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.
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