I have the default code below:
// enquiry form
if( !function_exists('tourmaster_get_enquiry_form') ){
function tourmaster_get_enquiry_form( $post_id = '' ){
if( !empty($post_id) ){
$custom_fields = get_post_meta($post_id, 'tourmaster-enquiry-form-fields', true);
}
if( empty($custom_fields) ){
$custom_fields = tourmaster_get_option('general', 'enquiry-form-fields', '');
}
if( empty($custom_fields) ){
$enquiry_fields = array(
'full-name' => array(
'title' => esc_html__('Full Name', 'tourmaster'),
'type' => 'text',
'required' => true
),
'email-address' => array(
'title' => esc_html__('Email Address', 'tourmaster'),
'type' => 'text',
'required' => true
),
'your-enquiry' => array(
'title' => esc_html__('Your Enquiry', 'tourmaster'),
'type' => 'textarea',
'required' => true
),
);
}else{
$enquiry_fields = tourmaster_read_custom_fields($custom_fields);
}
$ret = '<form class="tourmaster-enquiry-form tourmaster-form-field tourmaster-with-border clearfix" ';
$ret .= ' id="tourmaster-enquiry-form" ';
$ret .= ' data-ajax-url="' . esc_url(TOURMASTER_AJAX_URL) . '" ';
$ret .= ' data-action="tourmaster_send_enquiry_form" ';
$ret .= ' data-validate-error="' . esc_attr(esc_html__('Please fill all required fields.', 'tourmaster')) . '" ';
$ret .= ' >';
foreach( $enquiry_fields as $slug => $enquiry_field ){
$enquiry_field['echo'] = false;
$enquiry_field['slug'] = $slug;
$ret .= tourmaster_get_form_field($enquiry_field, 'enquiry');
}
$recaptcha = tourmaster_get_option('general', 'enable-recaptcha', 'disable');
if( $recaptcha == 'enable' ){
$ret .= apply_filters('gglcptch_display_recaptcha', '', 'tourmaster-enquiry');
}
$our_term = tourmaster_get_option('general', 'register-term-of-service-page', '#');
$our_term = is_numeric($our_term)? get_permalink($our_term): $our_term;
$privacy = tourmaster_get_option('general', 'register-privacy-statement-page', '#');
$privacy = is_numeric($privacy)? get_permalink($privacy): $privacy;
$ret .= '<div class="tourmaster-enquiry-term" >';
$ret .= '<input type="checkbox" name="tourmaster-require-acceptance" />';
$ret .= sprintf(wp_kses(
__('* I agree with <a href="%s" target="_blank">Terms of Service</a> and <a href="%s" target="_blank">Privacy Statement</a>.', 'tourmaster'),
array('a' => array( 'href'=>array(), 'target'=>array() ))
), $our_term, $privacy);
$ret .= '<div class="tourmaster-enquiry-term-message tourmaster-enquiry-form-message tourmaster-failed" >' . esc_html__('Please agree to all the terms and conditions before proceeding to the next step', 'tourmaster') . '</div>';
$ret .= '</div>';
$ret .= '<div class="tourmaster-enquiry-form-message" ></div>';
$ret .= '<input type="hidden" name="tour-id" value="' . get_the_ID() . '" />';
$ret .= '<input type="submit" class="tourmaster-button" value="' . esc_html__('Submit Enquiry', 'tourmaster') . '" />';
$ret .= '</form>';
return $ret;
}
}
And I want remove this part of code in the function above:
$our_term = tourmaster_get_option('general', 'register-term-of-service-page', '#');
$our_term = is_numeric($our_term)? get_permalink($our_term): $our_term;
$privacy = tourmaster_get_option('general', 'register-privacy-statement-page', '#');
$privacy = is_numeric($privacy)? get_permalink($privacy): $privacy;
$ret .= '<div class="tourmaster-enquiry-term" >';
$ret .= '<input type="checkbox" name="tourmaster-require-acceptance" />';
$ret .= sprintf(wp_kses(
__('* I agree with <a href="%s" target="_blank">Terms of Service</a> and <a href="%s" target="_blank">Privacy Statement</a>.', 'tourmaster'),
array('a' => array( 'href'=>array(), 'target'=>array() ))
), $our_term, $privacy);
$ret .= '<div class="tourmaster-enquiry-term-message tourmaster-enquiry-form-message tourmaster-failed" >' . esc_html__('Please agree to all the terms and conditions before proceeding to the next step', 'tourmaster') . '</div>';
$ret .= '</div>';
The default function don’t have filter, so I just add filter but not sure where to apply filter for it.