Car Demon Code Docs

  1. Home
  2. Car Demon Code Docs
  3. Form Filters
  4. cd_form_filter


This filter can be used to modify any of the Car Demon contact forms.

apply_filters(‘cd_form_filter’, $html, $type, $location);


$html – The current HTML for the form.
$type – The form currently being filtered: contact_us, finance, parts, qualify, service_appointment, trade_form, contact_us_vehicle, email_a_friend
$location – The vehicle location if known. If not known or does not apply then this will beĀ either ‘unk’ or an empty string.

add_filter( 'cd_form_filter', 'my_form', 10, 3 );
function my_form( $html, $type, $location ) {

    $html = '<div class="my_class">' . $html . '</div>';
    return $html

The above example will wrap all forms in a <div> tag with a CSS class of “my_class”.

Was this article helpful to you? Yes No

How can we help?