mirror of
https://gh.wpcy.net/https://github.com/mainwp/Code-Snippets-Functions.git
synced 2026-04-29 11:32:21 +08:00
https://stackoverflow.com/questions/70699315/display-user-description-in-woocommerce-admin-order-edit-pages-after-billing-add/70701368
18 lines
607 B
Text
18 lines
607 B
Text
function action_woocommerce_admin_order_data_after_billing_address( $order ) {
|
|
// Get user
|
|
$user = $order->get_user();
|
|
|
|
// Initialize
|
|
$output = __( 'Bio: ', 'woocommerce' );
|
|
|
|
// Is a WP user
|
|
if ( is_a( $user, 'WP_User' ) ) {
|
|
! empty( $user->description ) ? $output .= $user->description : $output .= __( 'n/c', 'woocommerce' );
|
|
} else {
|
|
$output .= __( 'n/c', 'woocommerce' );
|
|
}
|
|
|
|
// Output
|
|
echo $output;
|
|
}
|
|
add_action( 'woocommerce_admin_order_data_after_billing_address', 'action_woocommerce_admin_order_data_after_billing_address', 10, 1 );
|