Hi @fasil878,
Could you please try this snippet and see whether it helps?
<?php
add_filter( 'forminator_form_submit_response', 'wpmudev_add_reponse_query_param' , 20, 2 );
add_filter( 'forminator_form_ajax_submit_response', 'wpmudev_add_reponse_query_param' , 20, 2 );
function wpmudev_add_reponse_query_param( $response, $form_id ) {
if ( $form_id != 6 ) { //Please change the form ID
return $response;
}
$prefix = 'REG2022_';
$incremental = get_option( $form_id.'_autoincrement_int' );
if ( $incremental ) {
//remove prefix:
$incremental = str_replace( $prefix, '', $incremental );
$incremental = (int)$incremental;
}
if ( ! $incremental ) {
$incremental = 1;
} else {
$incremental = $incremental + 1;
}
update_option( $form_id.'_autoincrement_int', $prefix.$incremental );
$response['url'] = str_replace( '{random_digit}', $prefix.$incremental, $response['url'] );
return $response;
}
You’ll have to update the following line with your form ID:
if ( $form_id != 6 ) {
Support the from ID is 123, then the above line will change to:
if ( $form_id != 123 ) {
Also, please make sure the redirect URL added has the following {random_digit}
to print the random digit.
You can implement the given code as a mu-plugins. Please check this link on how to implement the above code as a mu-plugins:
https://wpmudev.com/docs/using-wordpress/installing-wordpress-plugins/#installing-mu-plugins
Best Regards,
Nithin