- Edited
It can be handy, especially during development, to have your most recent forms (those likely under active development) listed first in your form table. This snippet will allow you to set the default sort order to most recent.
Note: This feature is now available within the Gravity Hopper plugin.
// Order form list table by most recent
add_filter( 'gform_form_list_forms', function( $forms, $search_query, $active, $sort_column, $sort_direction, $trash ) {
if ( ! rgget( 'orderby' ) ) {
usort( $forms, function( $a, $b ) {
return $b->id <=> $a->id;
} );
}
return $forms;
}, 10, 6 );