I’m developing a plugin that create a custom post type.
I’ve created a custom meta box with a custom meta input field.
With an AJAX function, I duplicate the input field. They are the same name and the same class.
It’s all ok, but how can I save these data with save_post
hook action?
If I use the classic function, with update_post_meta
, it’s save only last value.
I need to create an array and pass it to the save function.
How?
If I use admin-ajax.php how can I pass the post_id
for update_post_meta
in callback function?
I don’t wanna use wpalchemy.
The input filed
name
has to be in array format:field_name[]
.In the
<form>
:Then in
save_post
action:Example adapted from here.
Thanks ! It’s perfect !
I use
for special chars like ‘à ,è,ì,ò,ù’ and it works perectly !
Thanks !