gform_updates_list

Description

The “gform_updates_list” filters the available updates displayed on the Forms -> System Status -> Updates page.

Usage

Note: Set the run priority higher than the default of 10 because this filter is also added in the auto upgrade Gravity Forms code and the list of updates will not be complete unless the filter in the GF code runs before your added filter.

add_filter( 'gform_updates_list', 'your_function_name', 11, 1 );

Parameters

  • $updates array

    An array of plugins displayed on the Updates page.

Example

This example removes a plugin from the list of available updates.

add_filter( 'gform_updates_list', 'remove_update', 11, 1 );

function remove_update( $updates ){
	//remove user registration from the updates list
	foreach( $updates as $id => $update ){
		//loop through array and create ids for the sub arrays
		//so the user registration plugin can be removed
		if ( $update['slug'] == 'gravityformsuserregistration' ){
			//remove it from the main array
			unset( $updates[$id] );
			break;
		}
	}

	return $updates;
}

Since

This filter was added in v2.2.

Placement

This code should be placed in the functions.php file of your active theme.

Source Code

This filter is located in GF_Update::available_updates() in gravityforms/includes/system-status/class-gf-update.php.