Skip to content

Gravity Wiz Terms or Service field only printing one checkbox (when there are multiple attached to the field) #1598

Description

@Kirstan82

Hi,

When using this plugin:
https://gravitywiz.com/documentation/gravity-forms-terms-of-service/

And adding more than one checkbox to this field, the PDF only displays the first one. Can this be updated to include all attached checkboxes please?

Here is a snippet provided by Gravity Wiz which does fix this issue:

add_filter( 'gfpdf_pdf_field_content', function( $value, $field, $entry, $form ) {
if ( $field->type != 'tos' ) {
return $value;
}

$pattern = '/^' . preg_quote( $field->id, '/') . '\.(?!1$)\d+$/';

foreach ( $entry as $key => $data ) {
	if ( preg_match( $pattern, $key ) ) {
		if ( $data ) {
			$value .= "<div class='terms-of-service-agreement'><span class='terms-of-service-tick' style='font-family:dejavusans,sans-serif;'>&#10004;</span> $data </div>";
		}
	}
}
return $value;

}, 10, 4 );

Thank you,

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions