Javid
Javid

Reputation: 512

Gravity forms unset fields dynamically

I'm successfully populating the Gravity form fields using "gform_pre_render " hook. now i need to remove few fields dynamically. I spend hours to looking into documentation and did google searches but no luck. Its really helpful if someone know how to unset fields in gravity form. Thanks in advance

Upvotes: 1

Views: 1756

Answers (1)

Javid
Javid

Reputation: 512

Ok, i find solution to unset fields

inside gform_pre_render hook we can unset fields like this

if( $field->id == 7 ){
   unset ( $form['fields'][7] );
}

Upvotes: 4

Related Questions