$obj->field_name = 'field_value'. If there was an empty field without name, without label, it caused error because of trying to create an object property with empty name
$prop_name = null; $obj->$prop_name = $field_val; // error!
Of course, I can just check if the field name is not empty, but I think it should be done during saving a field, because I’m sure no one needs a field without name, but one can create it ‘by accident’.
Just for rules, logically when the field is marked as required, and it really is required, it should be required.
Please consider adding this one or two lines of code, in the next version 🙂
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
© 2023 Advanced Custom Fields.