php - Run htmlentities() on all submitted values through gravity forms

admin2025-06-06  6

I need a way to run through all submitted values throghh the htmlentities() filter in gravity forms. I am using the gform_pre_submission filter. I am successfuly able to find the type of field since we donot want to do this for URLS or file inputs. But I do not know how to actually grab the fields within the form object. Here's the code I am using.

add_action( 'gform_pre_submission', 'pre_submission_handler' );
public function pre_submission_handler( $form ) 
{
    foreach ( $form['fields'] as $field ) {
        if ($field->type !== 'fileupload') {
            /* Run the field through htmlentitites filter */
        }
    }
}
转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1749175280a316992.html

最新回复(0)