Skip to content

Commit cee8009

Browse files
committed
gw-all-fields-template.php: Added filter to customize template content.
1 parent 5a8881b commit cee8009

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

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

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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 content loaded by the template.
597+
*
598+
* @since 0.12
599+
*
600+
* @param string $content The 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_content', $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)