Viewing 16 replies (of 16 total)
  • respectyoda

    (@respectyoda)

    You need to be using a child theme first. Once you are using a child theme, then create a file called ‘functions.php’ and drop the code in there.

    The filter function just puts the data in the textbox and once you configure it then you can go back to the Email & Actions tab and configure the message to say something like this:

    Your email is: [ninja_forms_field id=3]

    Keep in mind if you want to use data that is not associated with Ninja Forms such as a custom meta field, you will need to use the global $post variable. For example:

    function custom_reservation_fields_email( $data, $field_id ){
    // $data will contain all of the field settings that have been saved for this field.
    // Let's change the default value of the field if it has an ID of 3
     if( $field_id == 3 ){
        global $post;
        $data['default_value'] = get_post_meta($post->ID, 'reservation_number', true);
     }
     return $data;
    }
    add_filter( 'ninja_forms_field', 'custom_reservation_fields_email', 10, 2 );
Viewing 16 replies (of 16 total)
  • The topic ‘Disable multi-select certain checkboxes’ is closed to new replies.