Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gf-openai-post-save-result-to-field.php: Added snippet to populate fields with Open AI generated values. #649

Merged
merged 4 commits into from
Jan 10, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
} );
Loading