Created
November 4, 2014 22:51
-
-
Save amdrew/c48d40e13e4326c289eb to your computer and use it in GitHub Desktop.
Easy Digital Downloads - Add the customer's username to the payment's "Customer Details" section and link through to their user profile
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
<?php | |
/** | |
* Easy Digital Downloads - Add the customer's username to the payment's "Customer Details" section and link through to their profile | |
*/ | |
function sumobi_edd_customer_details_username( $payment_id ) { | |
$user_info = edd_get_payment_meta_user_info( $payment_id ); | |
$customer_id = $user_info['id']; | |
if ( ! $customer_id ) { | |
return; | |
} | |
$user_data = get_userdata( $customer_id ); | |
$user_name = $user_data->user_login; | |
?> | |
<div class="column-container" style="margin-top: 20px;"> | |
<div class="column"> | |
<strong><?php _e( 'Username:', 'edd' ); ?></strong><br /> | |
<a href="<?php echo get_edit_user_link( $customer_id ); ?>"><?php echo $user_name; ?></a> | |
</div> | |
</div> | |
<?php | |
} | |
add_action( 'edd_payment_view_details', 'sumobi_edd_customer_details_username' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment