Answer the question
In order to leave comments, you need to log in
How to properly process field data with a nonce?
Hello!
How to do wp_create_nonce for forms and process data through a one-time check is understandable, but how to check for such cases when there is no form, and the data is updated like this:
function user_rules( $user_id ) {
if ( ! empty( $_POST['user_rules'] ) ) {
update_user_meta( $user_id, 'user_rules', esc_attr( $_POST['user_rules'] ) );
}
}
add_action( 'user_register', 'user_rules' );
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question