Contact Form
These hooks let developers customize Contact Form in the Cost Calculator.
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
Parameters:
$classes(String)
$settings(Array)
Example:
ccb_contact_form_submit_action
This hook allows you to add HTML code to the submit button.
Parameters:
$settings(Array)
Example:
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.
Parameters:
$settings(Array)
Example:
ccb_contact_form_add_requires
This is a hook to add values for fields if the field is mandatory
Parameters:
$settings(Array)
Example:
ccb_contact_form_add_text_form_fields
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:
ccb_contact_form_submit_label
This is a hook that allows you to change the text of the submit button individually and globally.
Example:
ccb_contact_form_add_sendform_fields
This is the structure of all fields before submitting to the back end, and is a required part before submitting.
Parameters:
$settings(Array)
Example:
ccb_contact_form_invalid_error
This hook allows you to change the error text when submitting a form
Parameters:
$text(String)
Example:
ccb_contact_form_general_add_email_fields
Add additional fields to receive email notifications in the main calculator settings.
Example:
ccb_contact_form_settings_add_email_fields
This hook allows you to add recipients through individual calculator settings.
Example:
ccb_email_subject
This is a hook to change the subject of an email when sending a calculator form.
Parameters:
$subject(String)
$calc_id(Integer)
Example:
Last updated
Was this helpful?

