Support › Meta Box Builder › Default field is not workingResolved
`The default value is not working. When the metaboxes charge in the post, the value of the fields with default value are blank, don't return anything, until write or select something.
If the post is new, all the default values loads correctly, but if is old not.
It's my code:
For old posts, the custom fields already have some value (even empty values). So it doesn't make any sense to set the default value anymore.
It's possible force to recover the default values from metabox?
We have 5 metabox configurations, and by default witch type of post have a metabox. The idea is that all the custom psot type with name XX have the same default values from his metabox.
It will be possible to force that and old post come back to the defaults values?
If you just want to revert the default value for the old post, you can just run this code:
$post_id = 123; // Your post ID
$field_id = 'abc'; // The field ID
$default = 'some thing'; // Default value
update_post_meta( $post_id, $field_id, $default );
Put it in a functionality plugin and run it once.