spivurno
3/19/2014 - 6:08 PM

Allow HTML in confirmation (and other places) for radio and checkbox choice labels

Allow HTML in confirmation (and other places) for radio and checkbox choice labels

<?php

add_filter( 'gform_merge_tag_filter', 'gw_allow_choice_html', 10, 5 );
function gw_allow_choice_html( $value, $input_id, $options, $field, $raw_value ) {

    if( ! in_array( GFFormsModel::get_input_type( $field ), array( 'radio', 'checkbox' ) ) )
        return $value;

    foreach( $field['choices'] as $choice ) {
        if( $choice['value'] == $raw_value )
            return $raw_value;
    }

    return $value;
}