Skip to content

Instantly share code, notes, and snippets.

@jtsternberg
Created October 2, 2018 14:22
Show Gist options
  • Save jtsternberg/3f0dc8a229df3e94ac3c9fe22f1eb32b to your computer and use it in GitHub Desktop.
Save jtsternberg/3f0dc8a229df3e94ac3c9fe22f1eb32b to your computer and use it in GitHub Desktop.
Move wpforms description above field, and increase font-size.
<?php
function om_wpf_top_field_description( $properties, $field, $form_data ) {
if (
isset( $form_data['id'], $field['id'] )
&& 122765 === intval( $form_data['id'] )
&& 4 === intval( $field['id'] )
) {
add_action( 'wpforms_display_fields_after', 'om_wpf_top_field_description_font_size' );
$properties['description']['position'] = 'before';
}
return $properties;
}
add_filter( 'wpforms_field_properties', 'om_wpf_top_field_description', 10, 3 );
function om_wpf_top_field_description_font_size() {
echo '<style>
#wpforms-122765-field_4-container .wpforms-field-description {
font-size: 16px;
}
</style>';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment