Sort or remove fields
add_filter( ‘frm_entry_values_fields’, ‘sort_remove_fields’, 10, 2 ); function sort_remove_fields( $fields, $args ) { // Do anything with the $fields. // Your code here… return $fields; }Continue reading
Join 2,000,000+ Professionals who use WPCode to Future-Proof Their Websites!
add_filter( ‘frm_entry_values_fields’, ‘sort_remove_fields’, 10, 2 ); function sort_remove_fields( $fields, $args ) { // Do anything with the $fields. // Your code here… return $fields; }Continue reading
add_filter( ‘frm_entry_values_exclude_fields’, ‘specify_exclude_fields’, 10, 2 ); function specify_exclude_fields( $field_ids, $atts ) { $field_ids[] = 3013; return $field_ids; }Continue reading
add_filter(‘frm_google_chart’, ‘frm_add_haxis_options’, 10, 2); function frm_add_haxis_options( $options, $atts ){ $options[‘hAxis’]= array( ‘textStyle’ => array( ‘color’ => ‘green’, ‘fontSize’ => ’18’, ‘bold’=> true ) ); return $options; }Continue reading
add_filter( ‘frm_fields_for_csv_export’, ‘remove_specific_field_from_csv_export’, 10, 2 ); function remove_specific_field_from_csv_export( $fields, $args ) { $target_form_id = 220; // change 220 to the ID of the form if ( $target_form_id === (int) $args[‘form’]->id ) { $target_field_id = 1204; // change 1204 to the…Continue reading
add_filter( ‘frm_validate_entry’, ‘event_registration’, 20, 2 ); function event_registration( $errors, $values ) { if ( $values[‘form_id’] !== 304 ) {//Change 304 to the ID of your form return $errors; } $registration_field = 3080;// Set this field to the id of the…Continue reading
add_filter(‘frm_surveys_likert_css_variables’, ‘add_surveys_likert_css_variables’, 10, 2); function add_surveys_likert_css_variables( $variables, $field ) { if ( 13 == $field[‘id’] ) { //Replace 13 with the ID of your field $variables[‘–custom-variable’] = ‘1000px’; } return $variables; }Continue reading
add_filter(‘frm_likert_html’, ‘display_likert_html’, 10, 2); function display_likert_html( $html ) { return ‘ %1$s: %2$s ‘; }Continue reading
add_filter(‘frm_after_duplicate_field’, ‘frm_save_id_duplicate_field’, 10, 2); function frm_save_id_duplicate_field( $args ) { $new_field_options = $args[‘values’][‘field_options’]; $new_field_options[‘copied_from’] = $copy_field->id; FrmField::update( $field_id, array( ‘field_options’ => $new_field_options ) ); }Continue reading
add_filter(‘frm_choice_field_option_label’, ‘frm_wrap_choice_option_label’, 10, 2); function frm_wrap_choice_option_label( $label, $args ) { return ‘<div class=”your-custom-class”>’ . $label . ‘</div>’; }Continue reading
add_filter(‘frm_fields_in_form’, ‘frm_remove_likert_in_form’, 10, 2); function frm_remove_likert_in_form( $fields, $args ) { if ( 13 == $args[‘form’]->id ) { //Replace 13 with the ID of your field foreach ( $fields as $index => $field ) { if ( ‘likert’ == $field[‘type’] )…Continue reading