Home Forums General Issues imputed data return null value but is visible


imputed data return null value but is visible

  • Hi,

    I’m using ADVANCED CUSTOM FIELDS in my project adding custom data to the profile of my users.

    For this use the following function

    $user_id = wp_create_user( $_POST['val_username'], $_POST['val_password'],  $_POST['val_email']  );
    add_post_meta ( 'user_'.$user_id, 'nivel_de_acesso', $_POST['val_skill'], true);

    This works for my registration visually, but when trying to return this information to my session, I get the null field (with no value)

    However, when the access panel on the profile web page and save the data, everything starts to work.

    How do I input the data so that work since his first time?

    Sorry my English translator (lol)

  • The reason is that you are not saving another meta value that is needed. Have you tried using update_field()?

    This page also has information on field_keys and field_names and data needed to be stored in the database.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.