Created
October 2, 2018 14:22
-
-
Save jtsternberg/3f0dc8a229df3e94ac3c9fe22f1eb32b to your computer and use it in GitHub Desktop.
Move wpforms description above field, and increase font-size.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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