gform_export_entries_status_choices

Description

The gform_export_entries_status_choices allows the entry status choices on the Export Entries page to be filtered or extended. Defaults to Active, Spam, and Trash. Add-ons such as Moderation can use this to add custom choices, like “Toxic”.

Usage

add_filter( 'gform_export_entries_status_choices', 'your_function_name' );

Parameters

ParameterTypeDescription
$statusesarrayThe array of status choices. Each choice is an array containing label and value keys.

Examples

Add a custom status choice.

add_filter( 'gform_export_entries_status_choices', function( $statuses ) {

	$statuses[] = array(
		'label' => 'Status Label',
		'value' => 'new_status',
	);

	return $statuses;
} );

Remove the Trash choice.

add_filter( 'gform_export_entries_status_choices', function( $statuses ) {

	foreach ( $statuses as $key => $status ) {
		if ( 'trash' === $status['value'] ) {
			unset( $statuses[ $key ] );
		}
	}

	return array_values( $statuses );
} );

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 export.php.

Since

This filter was added in Gravity Forms 3.1.1.