Strip slashes from result choices

Code

Filename: gppa-strip-slashes-from-result-choices-text.php

<?php
/**
 * Gravity Perks // Populate Anything // Strip slashes from result choices
 * https://gravitywiz.com/documentation/gravity-forms-populate-anything/
 */


// replace "1" with the ID of the form you want this to apply to and "2" with the ID of the field you want this to apply to.
// you can optionally remove "_1_2" from the filter name (leaving you with just "gppa_input_choice") to automatically apply this to all forms and fields.
add_filter( 'gppa_input_choice_1_2', function( $choice, $field, $object, $objects ) {
	$choice['text'] = stripslashes( $choice['text'] );
	return $choice;
}, 10, 4 );

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.