How to Customize the Rich Text Field TinyMCE Icons

/** * Customize Rich Text Field TinyMCE buttons for top toolbar. * * @link https://wpforms.com/developers/how-to-customize-the-rich-text-field-tinymce-icons/ */ // Function to change the top toolbar function wpf_dev_customize_tinymce_buttons_toolbar1( $toolbar, $field_id, $field_data ) { $toolbar = [ ‘fontselect’, ‘fontsizeselect’, ‘forecolor’, ‘indent’, ‘outdent’, ‘italic’, ‘styleselect’,…Continue reading

How to Restrict Numbers in a Single Line Text Form Field

/** * Disallow numbers in a single-line text field * * @link https://wpforms.com/developers/how-to-restrict-numbers-in-a-single-line-text-form-field/ */ function wpf_dev_disallow_numbers_text_field( $fields, $entry, $form_data ) { // Optional, you can limit to specific forms. Below, we restrict output to // form ID #1000. if (…Continue reading

Adding Images to Checkboxes

ul#wpforms-1000-field_25 li.choice-1 label:before { content: “”; display: inline-block; background-image: url(http://yoursite.com/wp-content/uploads/2019/10/your-image-filename.png); background-size: 100%; height: 45px; width: 30px; background-repeat: no-repeat; position: relative; right: 5px; top: 20px; }Continue reading

How to Display Hidden Single Item Fields in Order Summary

/** * Display Hidden Single Item Fields in Order Summary * * @link https://wpforms.com/developers/how-to-display-hidden-single-item-fields-in-order-summary */ function wpf_include_singleitem_hiddentype_include_in_order_summary_footer($foot) { // replace the 1000 with your Form ID $form_data = wpforms()->form->get( 1000, [ ‘content_only’ => true ] ); // Replace with actual…Continue reading

Set a specific language for Cloudflare Turnstile.

/** * Set a specific language for Cloudflare Turnstile. * * @link https://wpforms.com/developers/how-to-set-the-language-for-cloudflare-turnstile */ function wpf_add_turnstile_language_script() { if (!wp_script_is(‘wpforms-recaptcha’, ‘enqueued’)) { return; } $language_code = ‘ar-eg’; // where ‘ar-eg’ is for Arabic (Egypt) language ?>Continue reading

Change the No Results Found text in Modern Dropdown

/** * Change the No Results Found text in Modern Dropdown. * * @link https://wpforms.com/developers/how-to-change-the-no-results-found-text-in-the-modern-dropdown-field/ */ function wpf_dev_change_modern_dropdown_noresults_text( $config, $forms ) { // Change 1369 to an ID of your actual form. if ( array_key_exists( 1369, $forms ) ) {…Continue reading

Disable the space key with the special CSS class

/** * Disable the space key with the special CSS class * Apply the class “wpf-disable-space” to the field to enable. * * @link https://wpforms.com/developers/how-to-disable-the-space-key-inside-a-form-field/ * */ function wpf_dev_disalbe_space() { ?>Continue reading

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