Skip to content

Commit

Permalink
gppa-lmt-modifier-img.php: Fixed issue where snippet instantiated t…
Browse files Browse the repository at this point in the history
…he GP_Populate_Anything_Live_Merge_Tags class too early.
  • Loading branch information
spivurno committed Jun 9, 2023
1 parent a71a372 commit 6890086
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions gp-populate-anything/gppa-lmt-modifier-img.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,11 @@
*/
add_filter( 'gppa_live_merge_tag_value', function( $value, $merge_tag, $form, $field_id, $entry_values ) {

$lmt = GP_Populate_Anything_Live_Merge_Tags::get_instance();
$modifiers = $lmt->extract_merge_tag_modifiers( $merge_tag );
if ( ! gp_populate_anything()->live_merge_tags ) {
return $value;
}

$modifiers = gp_populate_anything()->live_merge_tags->extract_merge_tag_modifiers( $merge_tag );
if ( ! rgar( $modifiers, 'img' ) ) {
return $value;
}
Expand Down

0 comments on commit 6890086

Please sign in to comment.