How to omit fields programmatically in NF3?
-
with NF 2.9, we used to omit a field completely from a form with (for example we don’t want to show Name + Email at all if user is logged in):
add_filter('ninja_forms_display_fields_array', 'dpcontent_filter_ninja_form_fields', 10, 2); function dpcontent_filter_ninja_form_fields($field_results, $form_id) { unset($field_results[$x]); // where x is name / email
So I now try and do this with NF3 (but line below breaks form – it does not even appear at all):
add_filter('ninja_forms_display_fields', 'dpcontent_nf_display_fields', 10, 1); function dpcontent_nf_display_fields($fields) { unset($fields[2]); // this line breaks the form, commenting it fixes form but how to remove field from form? return $fields; }
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘How to omit fields programmatically in NF3?’ is closed to new replies.