Skip to content

Commit 87fd28a

Browse files
authored
gf-openai-post-save-result-to-field.php: Added snippet to populate fields with Open AI generated values.
1 parent b119d2d commit 87fd28a

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?php
2+
/**
3+
* Gravity Perks // Gravity Forms OpenAI // Add support to re-populate fields with Open AI generated values.
4+
* https://gravitywiz.com/
5+
*
6+
* Enables the transfer of generated values from Gravity Forms OpenAI to GP Reload Form after form submission, which would otherwise not happen.
7+
* This ensures that the generated values from Gravity Forms OpenAI are reloaded into the form when GP Reload Form is loaded.
8+
*
9+
* Requires 1.0-beta-1.2; or newer of Gravity Forms OpenAI.
10+
*
11+
* Instruction Video: https://www.loom.com/share/341ab02ca790461fa852eda2f8e95fbc
12+
*
13+
* Instructions: https://gravitywiz.com/documentation/how-do-i-install-a-snippet/
14+
*/
15+
// Replace 1 with the form id, and 3 with the targetted field id.
16+
add_action( 'gf_openai_post_save_result_to_field_1', function ( $result ) {
17+
$_POST['input_3'] = $result;
18+
} );

0 commit comments

Comments
 (0)