Currently I am doing
public function prfx_meta_save ($post_id){
if (isset( $_POST[ 'firstname'])){
update_post_meta($post_id, 'firstname', $_POST[ 'firstname']);
}
if (isset( $_POST[ 'lastname'])){
update_post_meta($post_id, 'lastname', $_POST[ 'lastname']);
}
if (isset( $_POST[ 'sex'])){
update_post_meta($post_id, 'sex', $_POST[ 'sex']);
}
}
But I would like to somehow loop over all the post values (Not just the ones here) and save them all. So if I add more fields to my Meta Box it should save them without me having to add another update_post_meta
Thanks for the help
array
usingname
attribute on your html input fields likesomething[]
.