Hide Elementor AI Image

/* * Hide Elementor image optimization ads when choosing the post’s featured image on the backend * UPDATE: 20/06/24 Hide Elementor image optimization ads on Media Library, if closing the “x” is not enough. */ function hide_elementor_nag_admin() { ?>Continue reading

Elementor Form Autofill

/** * Add autocomplete setting to form fields. */ add_action( ‘elementor/element/form/section_form_fields/before_section_end’, function( \Elementor\Widget_Base $widget ) { $elementor = \ElementorPro\Plugin::elementor(); $control_data = $elementor->controls_manager->get_control_from_stack( $widget->get_unique_name(), ‘form_fields’ ); if( is_wp_error( $control_data ) ) { return; } $control_data[‘fields’] = $control_data[‘fields’] + [ ‘namespace_autocomplete’ =>…Continue reading

Displaying the Total Number of Entries on Your Site

/** * Custom shortcode to display the total number of entries for a form. * * Basic usage: [wpf_entries_count id=”FORMID” type=”TYPE”] * * Realtime counts could be delayed due to any caching setup on the site * * @link https://wpforms.com/developers/how-to-display-the-total-number-of-entries/…Continue reading

Adding French Time Format for the Date / Time field

/** * Add additional formats for the Time field Format dropdown using French time format. * * @link https://wpforms.com/developers/how-to-create-additional-formats-for-the-date-time-field-time-picker/ */ function wpf_dev_date_field_time_formats_french( $time_formats ) { $time_formats[ ‘G\\\hi\\\m’ ] = ‘French Format’; return $time_formats; } add_filter( ‘wpforms_datetime_time_formats’, ‘wpf_dev_date_field_time_formats_french’, 10, 1 );Continue reading

Creating Additional Format for the Date / Time field

/** * Add additional formats for the Time field Format dropdown. * * @link https://wpforms.com/developers/how-to-create-additional-formats-for-the-date-time-field-time-picker/ */ function wpf_dev_date_field_time_formats1 ( $time_formats ) { // Displays 2-digit hour, 2-digit minute, and 2-digit seconds $time_formats[ ‘H:i:s’ ] = ‘HH:MM:SS’; return $time_formats; } add_filter(…Continue reading

Changing sublabels for Email Field on a Single Form

/** * Customize email field properties. * * @link https://wpforms.com/developers/how-to-change-sublabels-for-the-email-field/ */ function wpf_dev_email_field_properties( $properties, $field, $form_data ) { // Only process this snippet on the form ID 123 if ( absint( $form_data[ ‘id’ ] ) !== 123 ) { return…Continue reading

Changing Sublabels for the Email Field

/** * Customize email field properties. * * @link https://wpforms.com/developers/how-to-change-sublabels-for-the-email-field/ */ function wpf_dev_email_field_properties( $properties, $field, $form_data ) { // Change sublabel values $properties[ ‘inputs’ ][ ‘primary’ ][ ‘sublabel’ ][ ‘value’ ] = __( ‘Enter Your Email’, ‘plugin-domain’ ); $properties[ ‘inputs’…Continue reading

Make the auction start price and auction dates required for vendors

/* WCV – Require auction start price and auction dates */ function wcv_make_field_required( $field ) { $field[‘custom_attributes’][‘required’] = ‘required’; $field[‘custom_attributes’][‘data-parsley-required-message’] = __( ‘This field is required.’, ‘wc-vendors’ ); return $field; } add_filter( ‘wcv_simple_auctions_end_date’, ‘wcv_make_field_required’ ); add_filter( ‘wcv_simple_auctions_start_date’, ‘wcv_make_field_required’ ); add_filter(…Continue reading

Using Conditional Logic to Change Date Picker Locale

/** * Conditionally apply the date picker locale strings, depending on what the * current locale is as defined by WPML. * * @link https://wpforms.com/developers/localize-the-date-picker-strings/ */ function wpf_dev_datepicker_apply_locale() { if ( defined( ‘ICL_LANGUAGE_CODE’ ) && ‘es’ == ICL_LANGUAGE_CODE ) {…Continue reading