Skip to content

Commit

Permalink
Add :url modifier for entry moderation merge tags (#219)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrcasual committed Aug 27, 2024
1 parent 8952774 commit 5565cca
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions includes/class-gravityview-entry-approval-merge-tags.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ public function _filter_gform_custom_merge_tags( $custom_merge_tags = array(), $
public function _filter_gform_replace_merge_tags( $text, $form = array(), $entry = array(), $url_encode = false, $esc_html = false ) {

$matches = array();
preg_match_all( '/{gv_((?:dis|un)?approve)_entry:?(?:(\d+)([d|h|m|s]))?:?(public)?}/', $text, $matches, PREG_SET_ORDER );
preg_match_all( '/{gv_((?:dis|un)?approve)_entry:?(?:(\d+)([d|h|m|s]))?:?(public)?:?(url)?}/', $text, $matches, PREG_SET_ORDER );

// If there are no matches, return original text
if ( empty( $matches ) ) {
Expand Down Expand Up @@ -233,8 +233,8 @@ protected function replace_merge_tag( $matches = array(), $text = '', $form = ar
'text' => $approval_link_text,
'form_id' => (int) $form['id'],
'action' => $action,
'format' => 'html',
'atts' => []
'format' => isset( $match[5] ) ? 'text' : 'html',
'atts' => [],
];

/**
Expand Down
1 change: 1 addition & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Beautifully display your Gravity Forms entries. Learn more on [gravitykit.com](h

= develop =

* Added: Modifier for entry moderation merge tags to output plain-text URLs (e.g., `{gv_approve_entry:url}`).
* Fixed: Merge tag support in the Source URL "Link Text" field setting
* Fixed: Deprecated filter notice if using GravityView Maps 3.1.0 or newer.
* Fixed: PHP 8.2 deprecation notice due to passing an empty value to `htmlspecialchars()` and creating dynamic class properties.
Expand Down

0 comments on commit 5565cca

Please sign in to comment.