Skip to content

Commit

Permalink
gf-openai-post-save-result-to-field.php: Added snippet to populate …
Browse files Browse the repository at this point in the history
…fields with Open AI generated values.
  • Loading branch information
saifsultanc committed Jan 10, 2025
1 parent aa6b37f commit 76a5e0f
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions gravityforms-openai/gf-openai-post-save-result-to-field.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
*
* Instructions: https://gravitywiz.com/documentation/how-do-i-install-a-snippet/
*/
// Replace 342 with the form id, and 3 with the targetted field id.
add_action( 'gf_openai_post_save_result_to_field_342', 'gw_openai_post_save_result' );
function gw_openai_post_save_result( $result ) {
// Replace 1 with the form id, and 3 with the targetted field id.
add_action( 'gf_openai_post_save_result_to_field_1', function ( $result ) {
$_POST['input_3'] = $result;
}
} );

0 comments on commit 76a5e0f

Please sign in to comment.