Get Ninja Forms ID Submit
I need to capture the submit id of a form being processed. Does anyone know how to do this during ninja_forms_post_process?
I'm trying to use $ ninja_forms_processing-> get_field_value and see if it's stored there, but it doesn't seem to make sense as it doesn't form the field.
Hooray!
source to share
sub_id
doesn't populate until ninja_forms_post_process
with priority 10, so you need to use something like below to get the id of the current view:
add_action( 'ninja_forms_post_process', function () {
global $ninja_forms_processing;
var_dump( $ninja_forms_processing->get_form_setting( 'sub_id' ) );
}, 11 );
source to share
You can simply get the id of the form, which is either you have one or more ninja forms. Go to functions.php in Wordpress theme (active theme), you must enable
global $ ninja_forms_processing;
to access things in ninja uniforms, here is all the code for it
add_action( 'ninja_forms_post_process', function () {
global $ninja_forms_processing;
$form_id = $ninja_forms_processing->get_form_ID();
echo $form_id;(you will get the form id which is submitted)
}
source to share