Skip to content

Instantly share code, notes, and snippets.

@patrickfreitasdev
Created November 6, 2020 00:45
Show Gist options
  • Save patrickfreitasdev/96e3bdf3bbbc25ca6f142855c866859f to your computer and use it in GitHub Desktop.
Save patrickfreitasdev/96e3bdf3bbbc25ca6f142855c866859f to your computer and use it in GitHub Desktop.
<?php
add_filter( 'forminator_addon_googlesheet_form_submitted_data', function( $submitted_data ) {
global $wpdb;
$entry_id = $wpdb->get_var( "SELECT `AUTO_INCREMENT` FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = '{$wpdb->dbname}' AND TABLE_NAME = '{$wpdb->prefix}frmt_form_entry';" );
if( $entry_id ){
$submitted_data['hidden-1'] = ( $entry_id - 1 );
}
return $submitted_data;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment