Hi, I am trying to make a form that has required fields, but if user is a logged-in wordpress admin, the required fields don't need to be filled in... I thought something like this would do it:
add_filter('gform_validation_2', 'admin_override', 10, 4);
function admin_override($result, $value, $form, $field){
if ( current_user_can('manage_options') )
{
$result["is_valid"] = true;
} else {
$result["is_valid"] = false;
};
return $result;
}
But it doesn't work, in fact it stops the form from loading all together... Can anyone please help me work this out?