Skip to content

Commit d678951

Browse files
gw-all-fields-template.php: Added filter to customize template content.
* `gw-all-fields-template.php`: Added filter to customize template content. * `gw-all-fields-template.php`: Added filter to customize template content. * Update gw-all-fields-template.php --------- Co-authored-by: David Smith <david@gravitywiz.com>
1 parent e5c053f commit d678951

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

gravity-forms/gw-all-fields-template.php

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* Plugin URI: https://gravitywiz.com/gravity-forms-all-fields-template/
99
* Description: Modify the {all_fields} merge tag output via a template file.
1010
* Author: Gravity Wiz
11-
* Version: 0.11
11+
* Version: 0.12
1212
* Author URI: http://gravitywiz.com
1313
*
1414
* Usage:
@@ -591,7 +591,20 @@ public function load_template( $slug, $name = null, $data = array(), $suffixes =
591591
include( $template );
592592
}
593593
$content = ob_get_clean();
594-
return ! $template ? false : $content;
594+
595+
/**
596+
* Filters the output loaded by the template.
597+
*
598+
* @since 0.12
599+
*
600+
* @param string $content The output content loaded by the template.
601+
* @param string $slug The slug name for the generic template.
602+
* @param string $name The name of the specialized template.
603+
* @param array $data An array of data extracted for use in the template.
604+
* @param array $suffixes An array of suffixes used to locate the template.
605+
*/
606+
$content = apply_filters( 'gwaft_template_output', $content, $slug, $name, $data, $suffixes );
607+
return ! $template && ! $content ? false : $content;
595608
}
596609

597610
public function get_template_part( $slug, $name = null, $load = true, $suffixes = array() ) {

0 commit comments

Comments
 (0)