From 17f0e0bdc704c3ea9befef624b39fac3a3e1be5c Mon Sep 17 00:00:00 2001 From: veryspry Date: Thu, 24 Aug 2023 17:15:01 +0200 Subject: [PATCH] `gpfr-global-filename-template.php`: Fixed issue where `{i}` merge tag would increment twice as fast as it should. --- gp-file-renamer/gpfr-global-filename-template.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/gp-file-renamer/gpfr-global-filename-template.php b/gp-file-renamer/gpfr-global-filename-template.php index 23e1d0c6..b2903313 100644 --- a/gp-file-renamer/gpfr-global-filename-template.php +++ b/gp-file-renamer/gpfr-global-filename-template.php @@ -7,7 +7,6 @@ * * Requires GP File Renamer v1.0.5+. */ -add_filter( 'gpfr_filename', function( $renamed_file, $file, $entry, $form, $field ) { - $renamed_file = gp_file_renamer()->get_template_value( '{entry:id}/{filename}-{i}', $file, $entry, $form, $field ); - return $renamed_file; +add_filter( 'gpfr_filename_template', function ( $template, $filename, $form, $field, $entry ) { + return '{entry:id}/{filename}-{i}'; }, 10, 5 );