| CARVIEW |
Select Language
HTTP/2 301
date: Mon, 29 Dec 2025 15:32:42 GMT
content-type: text/html; charset=UTF-8
location: https://docs.gravityforms.com/gform_leads_before_export/
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: MISS
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=fDwam0ZwB7O8O8zywXT2JtBZUPJiGUzgJNFEeBnXUpXEkiKXUMfjDgC8PcshJc6Kf3rsIT2jK%2BYbKI50F7kEWEv4YgCO%2FEQHaFfODG9NQmaGpYGx"}]}
cf-ray: 9b5a59f24d61cb77-BLR
HTTP/2 200
date: Mon, 29 Dec 2025 15:32:43 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: MISS
report-to: {"group":"cf-nel","max_age":604800,"endpoints":[{"url":"https://a.nel.cloudflare.com/report/v4?s=QZpkf%2FnJKNMJfDOB5lVnbICVZIrrICcmAfzuF247lYq8Crd7pvtnAO%2FIlNjNUOTj4SEk2wW0BqLEJqaUauPv7MT28PelljCNvRmA5BQKTZecDcA8"}]}
cf-cache-status: DYNAMIC
nel: {"report_to":"cf-nel","success_fraction":0.0,"max_age":604800}
content-encoding: gzip
cf-ray: 9b5a5a07995dcb77-BLR
gform_leads_before_export - Gravity Forms Documentation
gform_leads_before_export
Description
Allows entries to be changed before export is executed.
Usage
Apply to all forms.
add_filter( 'gform_leads_before_export', 'my_modify_entries_before_export_function', 10, 3 );
Apply to a specific form.
add_filter( 'gform_leads_before_export_{$form_id}', 'my_modify_entries_before_export_function', 10, 3 );
Parameters
- $entries array
An array of entry objects to be exported - $form array
The current form object - $pagingarray
The current paging for the export. Includes the following properties:
Examples
This example demonstrates how to use this hook to convert the entry object’s default “created_by” property (which is a user ID) to instead output the user’s display name.
add_filter( 'gform_leads_before_export', 'use_user_display_name_for_export', 10, 3 );
function use_user_display_name_for_export( $entries, $form, $paging ) {
foreach( $entries as &$entry ) {
$user = new WP_User( $entry['created_by'] );
if ( ! $user->ID )
continue;
$entry['created_by'] = $user->get( 'display_name' );
}
return $entries;
}
Placement
This code can be used in the functions.php file of the active theme, a custom functions plugin, a custom add-on, or with a code snippets plugin.
See also the PHP section in this article: Where Do I Put This Code?
Source Code
This filter is located in GFExport::start_export() in export.php.