Skip to main content

gform_add_meta()

function gform_add_meta( $entry_id, $meta_key, $meta_value, $form_id=null )

Add metadata associated with an entry.

Data will be serialized; Don't forget to sanitize user input.

Since:

  • Unknown
  • 2.5 (Return the result of the query.)

Source: forms_model.php:8531

Parameters

NameTypeDefaultDescription
$entry_idintThe ID of the entry where metadata is to be added.
$meta_keystringThe key for the meta data to be stored.
$meta_valuemixedThe data to be stored for the entry.
$form_idint | nullnullThe form ID of the entry (optional, saves extra query if passed when creating the metadata).

Returns

  • int | false — Returns the number of affected rows, or false if the operation fails.