1. Docs
  2. Property Hive – Core Plugin
  3. Enquiries
  4. Customise Enquiry Form Fields

Customise Enquiry Form Fields

To customise the fields shown within the enquiry form we have a filter that can be used as such:

add_filter( 'propertyhive_property_enquiry_form_fields', 'add_enquiry_field_form', 10, 1 );
function add_enquiry_field_form( $fields )
{
    $fields[] = array(
        'my_custom_field' => array(
            'type' => 'select', // text / textarea / date / select / hidden / checkbox / radio
            'label' => __( 'My Custom Field', 'propertyhive' ),
            'show_label' => true,
            'before' => '<div class="control control-my-custom-field">',
            'required' => true, // true/false
            'options' => array(
                'Option 1' => 'Option 1',
                'Option 2' => 'Option 2',
                'Option 3' => 'Option 3',
            )
        )
    );
    
    return $fields;
}

Once the form is submitted the value entered should automatically come through on the email and be added as part of the enquiry details recorded inside Property Hive.