Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // HTML description for DATEPICKER field
- add_filter( 'forminator_field_date_markup', 'wpmudev_render_html_date_desc', 10, 2 );
- function wpmudev_render_html_date_desc( $html, $field ) {
- if ( false !== strpos( $html, '{field_description}' ) ) {
- $description = '<p>This is description. Click <a href="">here</a> to know more</p>';
- $html = str_replace( '{field_description}', $description, $html );
- }
- return $html;
- }
- // HTML descriptions for ADDRESS field
- add_filter( 'forminator_field_address_markup', 'wpmudev_render_html_address_desc', 10, 2 );
- function wpmudev_render_html_address_desc( $html, $field ) {
- // first description
- if ( false !== strpos( $html, '{field_description_1}' ) ) {
- $description = '<p>This is 1 description. Click <a href="">here</a> to know more</p>';
- $html = str_replace( '{field_description_1}', $description, $html );
- }
- // second description
- if ( false !== strpos( $html, '{field_description_2}' ) ) {
- $description = '<p>This is 2 description. Click <a href="">here</a> to know more</p>';
- $html = str_replace( '{field_description_2}', $description, $html );
- }
- # you can repeat such "if" blocks more times,
- #just make sure to adjust number in both lines in {field_description_X} macro,
- #and use those macros accordingly in "Description" of Address field subfields.
- return $html;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement