We’re wish to get customer’s billing_phone
number & then put it under “My Account” or “My Address” section.
This way, our billing support can look up for a number to call from the front-end, w/o navigating into order management.
Tried using phone' => get_user_meta( $customer_id, $name . '_phone', true )
in my-address.php, but that isn’t working.
Any leads? Thank you.
You’re close – just need to tweak your arguments:
<?php echo get_user_meta( $customer_id, 'billing_phone', true ) ?>
Just make sure $customer_id
is the ID of the user – you probably want get_current_user_id()
instead.