I get something, i hope it can help you to fix.
You change something in the file : acf-frontend-form-element/main/frontend/forms/classes/form-submit.php
function get_redirect_url().
in version 3.15.3 :
public function get_redirect_url( $form ) {
if ( ! empty( $form['return'] ) ) {
return $form;
}
$redirect_url = '';
$form['message_location'] = 'other';
switch ( $form['redirect'] ) {
case 'custom_url':
if ( is_array( $form['custom_url'] ) ) {
$redirect_url = $form['custom_url']['url'];
} else {
$redirect_url = $form['custom_url'];
}
break;
case 'current':
global $wp;
$redirect_url = $form['current_url'];
// $form_args['reload_current'] = true;
$form['message_location'] = 'current';
break;
case 'referer_url':
$redirect_url = $form['referer_url'];
break;
case 'post_url':
$redirect_url = '%post_url%';
break;
}
}
In your last version :
public function get_redirect_url( $form ) {
if ( ! empty( $form['return'] ) ) {
return $form;
}
$redirect_url = '';
$form['message_location'] = 'other';
switch ( $form['redirect'] ) {
case 'custom_url':
if ( is_array( $form['custom_url'] ) ) {
$redirect_url = $form['custom_url']['url'];
} else {
$redirect_url = $form['custom_url'];
}
break;
case 'referer_url':
$redirect_url = $form['referer_url'];
break;
case 'post_url':
$redirect_url = '%post_url%';
break;
default:
global $wp;
$redirect_url = $form['current_url'];
// $form_args['reload_current'] = true;
$form['message_location'] = 'current';
}
return $form;
}
When i choose the action “referer”, the variable $form[‘redirect’] equals “referer”.
But in your switch, you don”t have the “referer” case, so with your modification, the option goes to default, and set the root url.