Setting Field Values

The function simple_fields_set_value() is used to update a simple field for a post.

5 thoughts on “Setting Field Values

  1. Ilya

    If I execute commands
    simple_fields_set_value($postId, ‘roomid’, null, ‘booking’, $formData[‘roomid’]);
    simple_fields_set_value($postId, ’email’, null, ‘booking’, $formData[’email’]);
    then second field not updated.

    But if I execute
    simple_fields_set_value($postId, ‘roomid’, 0, ‘booking’, $formData[‘roomid’]);
    simple_fields_set_value($postId, ’email’, 0, ‘booking’, $formData[’email’]);
    all is right.

    It was because $num_in_set in simple_fields/functions.php is global counter and accumulated with next command. To reset it – pass $num_in_set parameter not null.

Leave a Reply

Your email address will not be published. Required fields are marked *