| CARVIEW |
Select Language
HTTP/2 301
date: Sat, 27 Dec 2025 12:52:13 GMT
content-type: text/html; charset=UTF-8
location: https://docs.gravityforms.com/gform_entry_meta/
server: cloudflare
strict-transport-security: max-age=604800
strict-transport-security: max-age=31536000; includeSubDomains
x-content-type-options: nosniff
x-content-type-options: nosniff
x-xss-protection: 1; mode=block
x-xss-protection: 1; mode=block
x-frame-options: SAMEORIGIN
x-frame-options: SAMEORIGIN
content-security-policy: frame-ancestors 'self';
referrer-policy: no-referrer
referrer-policy: strict-origin-when-cross-origin
x-redirect-by: WordPress
fastcgi-cache: HIT
cf-cache-status: DYNAMIC
nel: {"report_to":"cf-nel","success_fraction":0.0,"max_age":604800}
report-to: {"group":"cf-nel","max_age":604800,"endpoints":[{"url":"https://a.nel.cloudflare.com/report/v4?s=3BPt1vFGZn%2BQ5O5yuFEqvD%2BZFnpq1nKGzp6oSeYWX2x7w3qpeIEQBnYdR2B54H866IZufJi2y9bBdTyRSzZ7XwoHGb7rRe78tjrh0fsHrmwX5hx6"}]}
cf-ray: 9b48f42d1b96860e-BLR
HTTP/2 200
date: Sat, 27 Dec 2025 12:52:13 GMT
content-type: text/html; charset=UTF-8
server: cloudflare
vary: Accept-Encoding
strict-transport-security: max-age=604800
strict-transport-security: max-age=31536000; includeSubDomains
x-content-type-options: nosniff
x-content-type-options: nosniff
x-xss-protection: 1; mode=block
x-xss-protection: 1; mode=block
x-frame-options: SAMEORIGIN
x-frame-options: SAMEORIGIN
content-security-policy: frame-ancestors 'self';
referrer-policy: no-referrer
referrer-policy: strict-origin-when-cross-origin
link: ; rel="https://api.w.org/"
link: ; rel="alternate"; title="JSON"; type="application/json"
link: ; rel=shortlink
fastcgi-cache: HIT
report-to: {"group":"cf-nel","max_age":604800,"endpoints":[{"url":"https://a.nel.cloudflare.com/report/v4?s=2bwUzDGeN22QKY6ZRnULmASPVy6VaP5Cp9LE%2FoerdK6D%2BPG%2Btd3MjVeMEdgl5bAWoBxNKR5gRIc4qmQi4wWDiQ3ybcdlW3hz7smcpVWtpBm8HvdW"}]}
cf-cache-status: DYNAMIC
nel: {"report_to":"cf-nel","success_fraction":0.0,"max_age":604800}
content-encoding: gzip
cf-ray: 9b48f42ebd0e860e-BLR
gform_entry_meta - Gravity Forms Documentation
gform_entry_meta
Description
Use this hook to add custom properties to the Entry object. Allows entry meta data to be added as sortable columns to the entry list and export entries file.
Usage
add_filter( 'gform_entry_meta', 'custom_entry_meta', 10, 2);
Parameters
- $entry_meta array
Entry meta array.
-
$form_id integer
The ID of the form from which the entry value was submitted.
Examples
1. Basic meta column
add_filter( 'gform_entry_meta', 'custom_entry_meta', 10, 2 );
function custom_entry_meta( $entry_meta, $form_id ) {
// data will be stored with the meta key named score
// label - entry list will use Score as the column header
// is_numeric - used when sorting the entry list, indicates whether the data should be treated as numeric when sorting
// is_default_column - when set to true automatically adds the column to the entry list, without having to edit and add the column for display
// update_entry_meta_callback - indicates what function to call to update the entry meta upon form submission or editing an entry
$entry_meta['score'] = array(
'label' => 'Score',
'is_numeric' => true,
'update_entry_meta_callback' => 'update_entry_meta',
'is_default_column' => true
);
return $entry_meta;
}
function update_entry_meta( $key, $lead, $form ) {
//update score
$value = "5";
return $value;
}
2. Meta column with filters
add_filter( 'gform_entry_meta', function ( $entry_meta, $form_id ) {
$entry_meta['test'] = array(
'label' => 'Test',
'is_numeric' => false,
'update_entry_meta_callback' => 'update_entry_meta_test',
'is_default_column' => false,
'filter' => array(
'key' => 'test',
'text' => 'Test',
'operators' => array(
'is',
'isnot',
)
),
);
return $entry_meta;
}, 10, 2 );
function update_entry_meta_test( $key, $entry, $form ){
//update test
$value = "thisisatest";
return $value;
}
3. Quiz Add-On Meta
add_filter( 'gform_entry_meta', array( 'GFQuiz', 'entry_meta' ), 10, 2);
public static function entry_meta($entry_meta, $form_id){
$form = RGFormsModel::get_form_meta($form_id);
$quiz_fields = GFCommon::get_fields_by_type( $form, array( 'quiz' ) );
if ( false === empty ( $quiz_fields ) ) {
$entry_meta['gquiz_score'] = array(
'label' => 'Quiz Score Total',
'is_numeric' => true,
'update_entry_meta_callback' => array('GFQuiz', 'update_entry_meta')
);
$entry_meta['gquiz_grade'] = array(
'label' => 'Quiz Grade',
'is_numeric' => false,
'update_entry_meta_callback' => array('GFQuiz', 'update_entry_meta')
);
$entry_meta['gquiz_percent'] = array(
'label' => 'Quiz Percentage',
'is_numeric' => true,
'update_entry_meta_callback' => array('GFQuiz', 'update_entry_meta')
);
$entry_meta['gquiz_is_pass'] = array(
'label' => 'Quiz Pass/Fail',
'is_numeric' => false,
'update_entry_meta_callback' => array('GFQuiz', 'update_entry_meta')
);
}
return $entry_meta;
}
public static function update_entry_meta($key, $lead, $form){
$value = "";
$results = self::get_quiz_results( $form, $lead, false );
if ( $key == "gquiz_score" )
$value = $results["score"];
elseif ( $key == "gquiz_percent" )
$value = $results["percent"];
elseif ( $key == "gquiz_grade" )
$value = $results["grade"];
elseif ( $key == "gquiz_is_pass" )
$value = $results["is_pass"] ? "1" : "0";
return $value;
}
Placement
This code should be placed in the functions.php file of your active theme.
Since
This filter was added in Gravity Forms version 1.7.
Source Code
This action hook is located in GFFormsModel::get_entry_meta() in forms_model.php.