Home / Admin / Position the Field Description Above the Form Field
Duplicate Snippet

Embed Snippet on Your Site

Position the Field Description Above the Form Field

Positions the field description above the form field.

Change the 999999 to match your own form ID. See https://wpforms.com/developers/how-to-locate-form-id-and-field-id/ to find your form ID.

60+
Code Preview
php
<?php
/**
 * Move the field description above the form field
 *
 * @link https://wpforms.com/developers/how-to-position-the-field-description-above-the-form-field/
 * 
 * For support, please visit: https://www.facebook.com/groups/wpformsvip
 */
function wpf_dev_field_properties( $properties, $field, $form_data ) {
     
    // Only process this snippet on form ID 999999
    // To find your form or field ID, visit https://wpforms.com/developers/how-to-locate-form-id-and-field-id/
    if ( absint( $form_data[ 'id' ] ) !== 999999 ) {
        return $properties;
    } 
     
    {
        // Position the field description above the form field
        $properties[ 'description' ][ 'position' ] = 'before';
    }
 
    return $properties;
}
add_filter( 'wpforms_field_properties', 'wpf_dev_field_properties', 10, 3 );

Comments

Add a Comment