Removing File Upload Fields from Notifications

add_filter( ‘wpforms_emails_notifications_field_ignored’, ‘wpf_ignore_email_fields’, 10, 3 ); function wpf_ignore_email_fields( $is_ignored, $field, $form_data ) { if ( empty( $form_data[‘id’] ) ) { return $is_ignored; } // TODO: Change `1` to your form ID. if ( (int) $form_data[‘id’] !== 1 ) { return…Continue reading

Removing the Header Image From Notification Emails of Specific Forms

/** * Remove header image from email notifications for specific form IDs. */ add_filter( ‘wpforms_emails_templates_general_set_initial_args’, ‘wpforms_remove_header_image_by_form_id’, 10, 2 ); function wpforms_remove_header_image_by_form_id( $args, $template ) { // List the form IDs that should NOT include a header image. $forms_without_header = array(…Continue reading

Adding a Clear Button to Reset All Fields in Your Form

document.addEventListener(‘DOMContentLoaded’, function() { // Change the form ID to match your WPForms form ID var form = document.getElementById(‘wpforms-form-10’); if (form) { var clearButton = document.createElement(‘button’); clearButton.type = ‘button’; clearButton.innerText = ‘Clear’; clearButton.class = ‘custom-btn’; clearButton.style.marginTop = ’10px’; clearButton.classList.add(‘custom-clear-button’); form.appendChild(clearButton); clearButton.addEventListener(‘click’,…Continue reading

How to Store Field Values in the WPForms Entry

/** * Show values in Dropdown, checkboxes, and Multiple Choice. */ add_action( ‘wpforms_fields_show_options_setting’, ‘__return_true’ ); /** * Save choices ‘values’ instead of ‘labels’ for the fields with ‘Show values’ option enabled. * * @link https://wpforms.com/developers/how-to-store-field-values-in-the-wpforms-entry/ */ function wpf_dev_process_filter_choices_values( $fields, $entry,…Continue reading

class DeleteUploadedFiles {}

/** * Class deleteuploadedfiles to delete uploaded files from the server * * @link https://wpforms.com/developers/class-deleteuploadedfiles/ */ namespace WPF; class DeleteUploadedFiles { /** * Should we delete files from the WordPress Media Library? * Change the constant to true to delete…Continue reading

Changing the Name Attribute of a Hidden Field

/** * Custom function to change the name attribute of hidden fields in any form. * * @link https://wpforms.com/developers/how-to-change-the-name-attribute-of-a-hidden-field/ */ function wpf_field_properties_hidden( $properties, $field, $form_data ) { // Optional, you can limit to specific forms. Below, we restrict output to…Continue reading

Customizing Checkbox and Radio Fields to Look Like Buttons (All Forms)

.wpforms-container input[type=radio], .wpforms-container input[type=checkbox] { position: absolute; opacity: 0; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0;} .wpforms-container input[type=radio] + label, .wpforms-container input[type=checkbox] + label { padding: 5px 10px !important; background-color:…Continue reading