U
U
UN_Tony2022-03-18 13:12:19
WordPress
UN_Tony, 2022-03-18 13:12:19

How to assign value to $_POST[ 'billing_phone' ] variable from another variable?

added a phone number to the WordPress registration form with this:

update_user_meta( $user_id, 'user_phone', sanitize_text_field( $_POST[ 'user_phone' ] ) );

how now to make this variable also assigned to the value $_POST['billing_phone']- the delivery phone in wokomers and displayed in the admin panel?

update_user_meta( $user_id, 'user_phone', sanitize_text_field( $_POST[ 'user_phone' ] ) );
update_user_meta( $user_id, 'user_phone', sanitize_text_field( $_POST[ 'billing_phone' ] ) );

and:
update_user_meta( $user_id, 'user_phone', sanitize_text_field( $_POST[ 'user_phone' ] ) );
$_POST[ 'billing_phone' ] = $_POST[ 'user_phone' ];

don't work... the first doesn't assign anything to anyone at all, the second doesn't assign anything $_POST[ 'billing_phone' ]...

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
makboriska, 2022-03-18
@makboriska

$_POST[ 'billing_phone' ] = $_POST[ 'user_phone' ];

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question