You aren’t retrieving the saved data and populating the form.
function swpd_render_info_fields()
{
?>
<label for="swpd_comany_addr">Company Address</label>
<input type="text" name="swpd_company_addr" id="swpd_company_addr" />
<?php
}
There is nothing in that function that would insert your saved data. You just write a blank form every time. You need to be conditionally populating the input
value.
function swpd_render_info_fields($post)
{
$meta = get_post_meta($post->ID);
$value = (!empty($meta['swpd_company_addr']))
? $meta['swpd_company_addr']
: '';
?>
<label for="swpd_comany_addr">Company Address</label>
<input type="text" name="swpd_company_addr" id="swpd_company_addr" value="<?php echo $value ?>" />
<?php
}
I am guessing a lot at how your code works but that is the idea. You have to populate the form with existing values from the DB or you are just starting over each time.