gform_add_meta()

gform_add_meta()

DescriptionUsageParametersExamplesSource Code

Description
The function 「gform_add_meta()」 adds the metadata associated with an entry in the Entry Meta table. The data will be serialized.
Usage
gform_add_meta( $entry_id, $meta_key, $meta_value, $form_id = null );

Parameters

$entry_id integer
The ID of the entry.

$meta_key string
The meta key of the meta value you wish to add.

$meta_value string
The value to be set as the new value for the specified meta key.

$form_id integer
The form ID of the entry. Optional (saves extra query if passed when creating the metadata).

Examples
This example inserts a value for a new meta key.
//inserts "This is test data" for the meta key "my_test_key" for entry id 14 for form id 1.
gform_add_meta(14, 'my_test_key', 'This is test data.', 1);

Source Code
This function is located in forms_model.php

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注