Adding a Video Before Your Form

/** * Output something before your form(s). * * @link https://wpforms.com/developers/how-to-add-a-video-before-your-form/ */ function wpf_dev_frontend_output_before( $form_data, $form ) { // Optional, you can limit to specific forms. Below, we restrict output to // form #999. if ( absint( $form_data[ ‘id’ ]…Continue reading

Custom Style Icons for Rating field

div.wpforms-container-full form#wpforms-form-1000 .wpforms-field-rating svg { fill: transparent !important; stroke: #448ccb !important; stroke-width: 20px !important; opacity: 1 !important; } div.wpforms-container-full form#wpforms-form-1000 .wpforms-field-rating-item svg:hover { fill: #448ccb !important; } div.wpforms-container-full form#wpforms-form-1000 .wpforms-field-rating-item.selected svg { fill: #448ccb !important; transform: none !important; } div.wpforms-container-full…Continue reading

Using Smart Tags in Your WordPress Rewrite Rules

/** * Using Smart Tags in WordPress rewrite rules * * @link https://wpforms.com/developers/how-to-use-smart-tags-in-your-wordpress-rewrite-rules/ */ // Register custom query var function register_query_var( $wp ) { parse_str( $wp->matched_query, $url ); if ( ! isset( $url[ ’email_address’ ] ) ) { return; }…Continue reading

Focused Form Fields

form#wpforms-form-1000 input:focus, form#wpforms-form-1000 textarea:focus { box-shadow: 5px 5px 10px #ccc; } form#wpforms-form-1000 input, form#wpforms-form-1000 textarea { transition: box-shadow 0.3s ease-in-out; } form#wpforms-form-1000 button[type=submit]:hover { box-shadow: 5px 5px 10px #ccc; border: 1px solid #ccc; background-color: #eee; } form#wpforms-form-1000 button[type=submit] { border:…Continue reading

Change the Payment Delimiter Inside Email Notifications

/** * Change the payment delimiter in the email notification * * @link https://wpforms.com/developers/how-to-change-the-payment-delimiter-inside-email-notifications/ */ function wpf_dev_entry_email_data( $fields, $entry, $form_data ) { // Only run on my form with ID = 310 if ( absint( $form_data[ ‘id’ ] ) !==…Continue reading

Create Custom Address Scheme

/** * WPForms Add new address field scheme (Custom) * * @link https://wpforms.com/developers/create-additional-schemes-for-the-address-field/ */ function wpf_new_address_scheme( $schemes ) { $schemes[ ‘custom’ ] = array( ‘label’ => ‘Custom’, ‘address1_label’ => ‘Address Line 1’, ‘address2_label’ => ‘Address Line 2’, ‘city_label’ => ‘City’,…Continue reading

How to Build a Profile Page Using Post Submissions

/** * Add a profile form using Post Submissions * * @link https://wpforms.com/developers/how-to-build-an-profile-form-using-post-submissions/ */ function wpf_post_submission_custom_content( $post_id, $fields, $form_data, $entry_id ) { // Only do this for form #1089. if ( absint( $form_data[ ‘id’ ] ) !== 1089 ) {…Continue reading

How to Display a List of WPForms Using a Shortcode

/** * Create shortcode to display all form titles in a list. * * Basic usage: [wpforms_all_forms] * * @link https://wpforms.com/developers/how-to-display-a-list-of-wpforms-using-a-shortcode/ */ add_shortcode(‘wpforms_all_forms’, function() { $args = [ ‘post_type’ => ‘wpforms’, ‘post_status’ => ‘publish’, ‘posts_per_page’ => -1, ]; $posts =…Continue reading

How to Change the Error Text for Failed Submissions

/** * Change the error text message that appears. * * @link https://wpforms.com/developers/how-to-change-the-error-text-for-failed-submissions/ */ function wpf_translated($translated_text, $text, $domain) { // Bail early if it’s not a WPForms string. if ($domain !== ‘wpforms-lite’) { return $translated_text; } // Compare against the…Continue reading

Remove Multiple Fields From {all_fields} in Notifications

/** * Remove Specific Fields from Notifications * * @link https://wpforms.com/developers/how-to-remove-specific-fields-from-notifications */ add_action(‘wpforms_loaded’, function() { add_filter(‘wpforms_entry_email_data’, function ($fields, $entry, $form_data) { // Bail early if form ID is not equal to 1000 if ((int)$form_data[‘id’] !== 1000) { return $fields; }…Continue reading