private static function scrubAttributes($field, $type = null)
    {
        $invalid_keys = [
            'default',
            'description',
            'label',
            'options',
        ];

        if ($type && $type ==='textarea') {
            $invalid_keys[] = 'value';
        }

        foreach ($invalid_keys as $invalid_key) {
            if (array_key_exists($invalid_key, $field)) {
                unset($field[$invalid_key]);
            }
        }
        return $field;
    }
private static function scrubAttributes($field, $type = null)
    {
        $invalid_keys = [
            'default',
            'description',
            'label',
            'options',
        ];

        if ($type && $type ==='textarea') {
            $invalid_keys[] = 'value';
        }

        foreach ($invalid_keys as $invalid_key) {
            if (array_key_exists($invalid_key, $field)) {
                unset($field[$invalid_key]);
            }
        }
        return $field;
    }
private static function scrubAttributes ( $ field , $ type = null ) { $ invalid_keys = [ 'default' , 'description' , 'label' , 'options' , ] ; if ( $ type && $ type === 'textarea' ) { $ invalid_keys [ ] = 'value' ; } foreach ( $ invalid_keys as $ invalid_key ) { if ( array_key_exists ( $ invalid_key , $ field ) ) { unset ( $ field [ $ invalid_key ] ) ; } } return $ field ; }
Remove invalid HTML attribute keys from field definition
@param array $field
@return array
Remove invalid HTML attribute keys from field definition