I have the following function, but this will just move the ‘name’ field to the 'standard_fields` group. Am I missing something or is this a bug?
As you can see in the screenshot the “Naam” field (“Name” in English) has moved the the field group above it (Standard fields)
function disable_name_advanced_field_type($field_groups)
{
// Loop through field groups
foreach ($field_groups as &$group) {
if ($group['name'] === 'advanced_fields') {
// Loop through fields in the "advanced_fields" group
foreach ($group['fields'] as $key => $field) {
// Check for the "name" field and remove it
if ($field['data-type'] === 'name') {
unset($group['fields'][$key]);
}
}
}
}
return $field_groups;
}
add_filter('gform_field_groups_form_editor', 'disable_name_advanced_field_type');
What I would think what would happen running this function is that it gets unset from the advanced_fields
and with it removed from the list.
I’ve also tried creating the same function twice and changing if ($group['name'] === 'advanced_fields') {
to if ($group['name'] === 'standard_fields') {
, but this does nothing.