Skip to content

Commit a402657

Browse files
saifsultancclaygriffiths
authored andcommitted
Fixed an issue where GP Populate Anything values would not get populated when Gravity Forms OpenAI was enabled.
1 parent 5791a3b commit a402657

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

class-gwiz-gf-openai.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1279,6 +1279,11 @@ public function get_text_from_response( $response ) {
12791279
* @return string The text with merge tags processed.
12801280
*/
12811281
public function replace_merge_tags( $text, $form, $entry, $url_encode, $esc_html, $nl2br, $format ) {
1282+
// Process merge tags only if they are an openai feed.
1283+
if ( ! strpos( $text, 'openai_feed' ) ) {
1284+
return $text;
1285+
}
1286+
12821287
preg_match_all( '/{[^{]*?:(\d+(\.\d+)?)(:(.*?))?}/mi', $text, $field_variable_matches, PREG_SET_ORDER );
12831288

12841289
foreach ( $field_variable_matches as $match ) {

0 commit comments

Comments
 (0)