gpi_scope_field_options

  1. Description
  2. Usage
  3. Parameters
  4. Since

Description

Filter the options available in a scope’s drop down on the Inventory page. Useful when a scope field’s values are populated programmatically (e.g. a Hidden field) and the desired options can be neither derived from the field’s choices nor found in previously submitted entries.

Usage

Applied globally

add_filter( 'gpi_scope_field_options', 'my_custom_function' );

Applied to specific form

add_filter( 'gpi_scope_field_options_FORMID', 'my_custom_function' );

Applied to specific field

add_filter( 'gpi_scope_field_options_FORMID_FIELDID', 'my_custom_function' );

Parameters

$options array

The scope options. Each option is an array with a value and a label key. value must match the value as it is stored in the entry.

$field GF_Field|bool

The scope field. false if the field no longer exists.

$field_id string

The ID of the scope field.

$form_id int

The ID of the form to which the scope field belongs.

Since

  • 1.0.28 Hook added.