Disable Truncation

This will prevent the words in a specific field from being truncated when the limit is reached.

Instructions

Code

Filename: gpwc-disable-truncation.php

<?php
/**
 * Gravity Perks // Word Count // Disable Truncation
 * https://gravitywiz.com/documentation/gravity-forms-word-count/
 *
 * Instruction Video: https://www.loom.com/share/4f588b75b8bb46d7b2d1bdb9ce11f56e
 *
 * This will prevent the words in a specific field from being truncated when the limit is reached.
 */
add_filter( 'gpwc_script_args', function( $args, $field ) {
	// Update "123" to your form ID and "4" to your Word-Count-enabled field.
	if ( $field->formId == 123 && $field->id == 4 ) {
		$args['truncate'] = false;
	}
	return $args;
}, 10, 2 );

Leave a Reply

Your email address will not be published. Required fields are marked *

  • Trouble installing this snippet? See our troubleshooting tips.
  • Need to include code? Create a gist and link to it in your comment.
  • Reporting a bug? Provide a URL where this issue can be recreated.

By commenting, I understand that I may receive emails related to Gravity Wiz and can unsubscribe at any time.