mirror of
https://gh.wpcy.net/https://github.com/mainwp/Code-Snippets-Functions.git
synced 2026-05-01 11:52:25 +08:00
https://github.com/easydigitaldownloads/library/blob/master/_admin/add-username-to-customer-details.html
20 lines
634 B
Text
20 lines
634 B
Text
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' );
|