---
id: gk-gravityview-template-options-pre-context
title: "Filter - gk/gravityview/template/options/pre-context"
sidebar_label: "gk/gravityview/template/options/pre-context"
tags:
  - "3.1.0"
---

# Filter: gk/gravityview/template/options/pre-context

Filters the typed field options before context filtering.

Unlike `gk/gravityview/template/options`, this runs before options are filtered by their `contexts` key, so added options are context-filtered.

## Parameters

| Name | Type | Description |
|------|------|-------------|
| $field_options | `array` | Array of field options with <code>label</code>, <code>value</code>, <code>type</code>, <code>default</code> keys. |
| $field_type | `string` | The object type: <code>field</code>, <code>widget</code>, <code>search</code>, or a specific type name. |
| $template_id | `string` | The template ID. |
| $field_id | `string` | GF Field ID. Example: <code>3</code>, <code>5.2</code>, <code>entry_link</code>, <code>created_by</code>. |
| $context | `string` | What context are we in? Example: <code>single</code> or <code>directory</code>. |
| $input_type | `string` | The input type (<code>textarea</code>, <code>list</code>, <code>select</code>, etc.). |
| $form_id | `int` | The form ID. |

### Since

- 3.1.0

### Source

Defined in `src/Admin/Rendering/RenderSettings.php` at line 303

