| 1 |
<?php |
| 2 |
/* handle field output */ |
| 3 |
function wppb_heading_handler( $output, $form_location, $field, $user_id, $field_check_errors, $request_data ){ |
| 4 |
if ( $field['field'] == 'Heading' ){ |
| 5 |
$item_title = apply_filters( 'wppb_'.$form_location.'_heading_custom_field_'.$field['id'].'_item_title', wppb_icl_t( 'plugin profile-builder-pro', 'custom_field_'.$field['id'].'_title_translation', $field['field-title'], true ) ); |
| 6 |
$item_description = wppb_icl_t( 'plugin profile-builder-pro', 'custom_field_'.$field['id'].'_description_translation', $field['description'], true ); |
| 7 |
|
| 8 |
if( isset( $field['heading-tag'] ) ) { |
| 9 |
$heading_tag = $field['heading-tag']; |
| 10 |
} else { |
| 11 |
$heading_tag = 'h4'; |
| 12 |
} |
| 13 |
|
| 14 |
$heading_element1 = ( ( $form_location == 'back_end' ) ? '<h3>' : '<'. $heading_tag .' class="extra_field_heading">' ); |
| 15 |
$heading_element2 = ( ( $form_location == 'back_end' ) ? '</h3>' : '</'. $heading_tag .'>' ); |
| 16 |
|
| 17 |
$output = $heading_element1 . $item_title . $heading_element2 . '<span class="wppb-description-delimiter">'.$item_description.'</span>'; |
| 18 |
|
| 19 |
return apply_filters( 'wppb_'.$form_location.'_heading_custom_field_'.$field['id'], $output, $form_location, $field, $user_id, $field_check_errors, $request_data ); |
| 20 |
} |
| 21 |
} |
| 22 |
add_filter( 'wppb_output_form_field_heading', 'wppb_heading_handler', 10, 6 ); |
| 23 |
add_filter( 'wppb_admin_output_form_field_heading', 'wppb_heading_handler', 10, 6 ); |