Hi there, I have a custom post type to represent a dog (for a dog shelter website). I use front end submission to create/edit dogs.
The edit for shortcode looks like this
[mb_frontend_form id="intake_fields,dog_fields,dog_attrs_fields,fee_fields" post_id='current' post_type='dogs' edit='true']
The dog_fields field group has a field called dog_name. As shown in the video, when I create a dog entry the name is not getting saved. This used to work earlier so I'm not sure if something has changed. Can you help me understand where things are failing
Can you please share the PHP code generated from those field groups on your site? Please use this tool to share the code https://pastebin.com/
You can also try to change the field ID to
dog_name1 and see if it helps. Refer to the documentation to get PHP code https://docs.metabox.io/extensions/meta-box-builder/#getting-php-code
Sure thing. You can find the php code here https://pastebin.com/SvZPNyx1
Also note that fields not saving is not unique to the dog_name field. There is another field for description that too does not save etc. A dog has multiple field groups as shown in the edit shortcode above
As I can see in the field settings, the field value will not be saved to the database because
save_field is set to
false. Please read more on the documentation https://docs.metabox.io/field-settings/
[ 'name' => __( 'Dog Name', 'your-text-domain' ), 'id' => $prefix . 'dog_name', 'type' => 'text', 'required' => true, 'save_field' => false, // here ],
In the builder, please enable the option
Save field value in the tab Advanced, screenshot https://monosnap.com/file/Kzg6AMQGJOFtcT5HfciPbFQGrWk8Uk
Thanks hopefully this helps fix it for now.
But, did this change in a recent update? All fields have that setting unchecked and this should have never worked if it was this way.
I'm not sure what happens on your site, this setting does not affect by updating to the new version. But glad to see it works. Let me know if you have any questions.