Skip to content

Instantly share code, notes, and snippets.

@matty0501
Last active July 31, 2023 13:21
Show Gist options
  • Save matty0501/474b811cbbaf8c27e34ec92272e4e359 to your computer and use it in GitHub Desktop.
Save matty0501/474b811cbbaf8c27e34ec92272e4e359 to your computer and use it in GitHub Desktop.
<?php
/**
* Gravity Perks // GP Google Sheets // Admin Columns Pro Inline Edit Compatability
*
* Allow the Google Sheet to be updated after the entry is edited by Admin Columns Pro Inline Edit
*
* Installation:
* 1. Install per https://gravitywiz.com/documentation/how-do-i-install-a-snippet/
*/
add_action( 'acp/editing/saved', function ( AC\Column $column, $id ) {
$entry = GFAPI::get_entry( $id );
$form_id = rgar( $entry, 'form_id' );
gp_google_sheets()->handle_after_update_entry( GFAPI::get_form( $form_id ), $entry );
}, 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment