Hello,
You most likely have an issue at the location where you set the photo_id = '...'
in your acfe_form()
function or acfe/load_form
hook.
I would recommend to check the PHP code where you set this photo_id
, and log the value there to make sure everything is in order.
If the photo_id
doesn’t return a proper Post ID (number), then your “Post Action” will not be executed, as no post can be updated. And thus, the acfe/form/submit_post/form=photo-add2
hook won’t be executed.
You can check your Form configuration using Global Form hooks (see documentation).
On form load with acfe/load_form
(see documentation):
// log form on load
add_filter('acfe/form/load_form/form=photo-add2', 'my_form_load');
function my_form_load($form){
// log
acf_log('load_form', $form);
// return normally
return $form;
}
On form submission with acfe/form/submit_form
(see documentation):
// log on submit
add_action('acfe/form/submit_form/form=photo-add2', 'my_form_submit');
function my_form_submit($form){
// log
acf_log('submit_form', $form);
}
Both these logs should show you $form['photo_id'] = 45
(any number, is should be a post id). If there is no post id, then check your PHP code where you set it.
Hope it helps!
Regards.