Skip to content

Commit 5b51b48

Browse files
committed
gf-openai-post-save-result-to-field.php: Added snippet to populate fields with Open AI generated values.
1 parent 0161d8d commit 5b51b48

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
/**
3+
* Gravity Perks // GravityForms-OpenAI // Add support to populate fields with Open AI generated values.
4+
*
5+
* https://gravitywiz.com/
6+
*
7+
* Requires 1.0-beta-1.2; or newer of Gravity Forms OpenAI.
8+
*
9+
* Instructions:
10+
* - Install using https://gravitywiz.com/gravity-forms-custom-javascript/
11+
*/
12+
// Replace 342 with the form id, and 3 with the targetted field id.
13+
add_action( 'gf_openai_post_save_result_to_field_342', 'gw_openai_post_save_result' );
14+
function gw_openai_post_save_result( $result ) {
15+
$_POST['input_3'] = $result;
16+
}

0 commit comments

Comments
 (0)