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 authored Jan 10, 2025
1 parent b119d2d commit 87fd28a
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions gravityforms-openai/gf-openai-post-save-result-to-field.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php
/**
* Gravity Perks // Gravity Forms OpenAI // Add support to re-populate fields with Open AI generated values.
* https://gravitywiz.com/
*
* Enables the transfer of generated values from Gravity Forms OpenAI to GP Reload Form after form submission, which would otherwise not happen.
* This ensures that the generated values from Gravity Forms OpenAI are reloaded into the form when GP Reload Form is loaded.
*
* Requires 1.0-beta-1.2; or newer of Gravity Forms OpenAI.
*
* Instruction Video: https://www.loom.com/share/341ab02ca790461fa852eda2f8e95fbc
*
* Instructions: https://gravitywiz.com/documentation/how-do-i-install-a-snippet/
*/
// 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 87fd28a

Please sign in to comment.