Skip to main content

Action: gform_state_pre_encode

Dynamic Hook Name

This hook supports dynamic naming with the following modifiers:

  1. $form_id

Example hook names:

  • gform_state_pre_encode (base hook)
  • gform_state_pre_encode_1 (with first modifier value)

Allows additional values to be added to the state before it is encoded.

Parameters

NameTypeDescription
$state_handler\State_HandlerThe state handler instance.
$keysstring|int[]The keys of the state values that will be encoded.
$form_idintThe ID of the form the state is being generated for.

Since

Source

Defined in includes/form-display/state/class-state-handler.php at line 128