These hooks let developers customize Contact Form in the Cost Calculator.
Important: Developers can use these hooks to customize only the default form.
ccb_contact_form_style_class
This hook allows to change classes of the form itself
Parameters:
$classes(String)
$settings(Array)
Example:
add_filter(ccb_contact_form_style_class, 'add_form_class', 10, 2);
function add_form_class($classes, $settings){
$classes .= ' my_class'; //replace my_class with the name of your class
return $classes;
}
ccb_contact_form_submit_class
This hook allows you to change the classes of the form itself
This hook allows you to add HTML code to the submit button.
Parameters:
$settings(Array)
Example:
add_action('ccb_contact_form_submit_action', 'your_function_name');
function your_function_name($settings){
if($settings['calc_id'] == 240){ //change 240 to your calculator ID!
echo 'custom html code';
}
}
ccb_contact_form_add_fields
This hook adds additional fields to the contact form, when adding an additional field you need to add two hooks ccb_contact_form_add_requires, ccb_contact_form_add_text_form_fields and ccb_contact_form_add_sendform_fields as these parts are mandatory when adding new fields, otherwise when submitting the form an empty value will be passed to the back part.
This is a hook to add text values that are warnings in case the user has not filled in the required fields.
Parameters:
$settings(Array)
Example:
add_filter('ccb_contact_form_add_text_form_fields', 'add_sendform_required_text_fields', 10, 1);
function add_sendform_required_text_fields($textMessages){
$textMessages['new_message'] = 'New message is required to be filled.';
return $textMessages;
}
ccb_contact_form_submit_label
This is a hook that allows you to change the text of the submit button individually and globally.