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.
So… I’ve just written few handy functions to deal with saving, updating and deleting Simple Field items. I have to ask my employer if I can publish it. Also it needs tests.
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.
So… I’ve just written few handy functions to deal with saving, updating and deleting Simple Field items. I have to ask my employer if I can publish it. Also it needs tests.
hey Par,
push push 😉
I too would like to know about it
Hey Par,
Is there a way to delete Simple Field items this way?