Description

Fires on form load to display the field properties such as labels, sublabels, and descriptions.

Parameters

$field
(array) Sanitized field data.
$properties
(array) An array of field properties such as labels, sublabels and description.
$form_data
(array) Processed form settings/data, prepared to be used later.

Source

wpforms/pro/includes/class-frontend.php

More Information

The wpforms_field_properties filter is applied to an array for specific form field properties. Each form field will have it’s own unique name, such as wpforms_field_properties_email, wpforms_field_properties_html, wpforms_field_properties_name, wpforms_field_properties_address, wpforms_field_properties_password, wpforms_field_properties_stripe-credit-card, wpforms_field_properties_credit-card etc.

Examples

In this example shown below, the function will have the field Description display above the field itself but only for the form ID 225.

/**
 * Move the field description above the form field.
 *
 * @link   https://wpforms.com/developers/wpforms_field_properties/
 * 
 * @param  array $properties Field properties.
 * @param  array $field      Field settings. 
 * @param  array $form_data  Form data and settings.
 *
 * @return array
 */
 
function wpf_dev_field_properties( $properties, $field, $form_data ) {

    if ( absint( $form_data['id'] ) !== 225 ) {
        return $properties;
    } {
        $properties['description']['position'] = 'before';
    }

    return $properties;

}
add_filter( 'wpforms_field_properties', 'wpf_dev_field_properties', 10, 3 );

Snippet References: How to Position the Field Description Above the Form Field