Abruf
Elemente des Suchauftrags-Formulars (Frontend)
Parameter
Name (Typ) |
---|
$elements (array) |
$scope (string) |
all: alle Elemente (Standard) |
compact: nur E-Mail-Adresse, Objektart, Vermarktungsart, Ort und Radius (Umkreissuche) |
$keys_only (bool) |
Rückgebewert (Beispiele)
Original-Array ($scope
= all, $keys_only
= false):
$elements = [
'salutation' => [
'scope' => [ 'all' ],
'required' => false,
'title' => __( 'Salutation', 'immonex-notify' ),
'options' => [
'x' => __( 'n/a', 'immonex-notify' ),
'm' => __( 'Mr.', 'immonex-notify' ),
'f' => __( 'Ms.', 'immonex-notify' ),
],
],
'first_name' => [
'scope' => [ 'all' ],
'required' => false,
'placeholder' => __( 'First Name', 'immonex-notify' ),
],
'last_name' => [
'scope' => [ 'all' ],
'required' => false,
'placeholder' => __( 'Last Name', 'immonex-notify' ),
],
'email' => [
'scope' => [ 'all', 'compact' ],
'required' => true,
'placeholder' => __( 'Email Address', 'immonex-notify' ),
],
'property_type' => [
'scope' => [ 'all', 'compact' ],
'required' => true,
'is_search_criterion' => true,
'title' => __( 'Property Type', 'immonex-notify' ),
'placeholder' => __( 'I am looking for…', 'immonex-notify' ),
'options' => [
'room' => [
'title' => __( 'Room', 'immonex-notify' ),
],
'flat' => [
'title' => __( 'Flat', 'immonex-notify' ),
],
'house' => [
'title' => __( 'House', 'immonex-notify' ),
],
'house_single' => [
'title' => __( 'Single-family House', 'immonex-notify' ),
],
'house_multi' => [
'title' => __( 'Multi-family House', 'immonex-notify' ),
],
'house_row' => [
'title' => __( 'Row House', 'immonex-notify' ),
],
'lot' => [
'title' => __( 'Lot', 'immonex-notify' ),
],
'office' => [
'title' => __( 'Office', 'immonex-notify' ),
],
'retail' => [
'title' => __( 'Retail Space', 'immonex-notify' ),
],
'gastro_hotel' => [
'title' => __( 'Gastronomy Property/Hotel', 'immonex-notify' ),
],
'storage_prod' => [
'title' => __( 'Storage or Production Property', 'immonex-notify' ),
],
'investment' => [
'title' => __( 'Investment Property', 'immonex-notify' ),
],
],
],
'marketing_type' => [
'scope' => [ 'all', 'compact' ],
'required' => true,
'is_search_criterion' => true,
'title' => __( 'Marketing Type', 'immonex-notify' ),
'placeholder' => __( '…for sale/for rent', 'immonex-notify' ),
'options' => [
'sale' => [
'title' => __( 'for sale', 'immonex-notify' ),
],
'rent_lease' => [
'title' => __( 'for rent', 'immonex-notify' ),
],
],
],
'location' => [
'scope' => [ 'all', 'compact' ],
'is_search_criterion' => true,
'required' => false,
'placeholder' => __( 'Locality', 'immonex-notify' ),
],
'distance_radius' => [
'scope' => [ 'all', 'compact' ],
'required' => false,
'is_search_criterion' => true,
'title' => __( 'Distance Radius', 'immonex-notify' ),
'options' => [
'10' => '10 km',
'25' => '25 km',
'50' => '50 km',
'100' => '100 km',
],
],
'area' => [
'scope' => [ 'all' ],
'required' => false,
'is_search_criterion' => true,
'title' => __( 'Area (min/max)', 'immonex-notify' ),
'min_max' => [
'default' => [ 0, 400 ],
'room' => [ 0, 100 ],
'flat' => [ 0, 250 ],
'house' => [ 0, 400 ],
'house_single' => [ 0, 400 ],
'house_multi' => [ 0, 800 ],
'house_row' => [ 0, 400 ],
'lot' => [ 0, 3000 ],
'office' => [ 0, 3000 ],
'retail' => [ 0, 3000 ],
'gastro_hotel' => [ 0, 5000 ],
'storage_prod' => [ 0, 5000 ],
'investment' => [ 0, 5000 ],
],
],
'rooms' => [
'scope' => [ 'all' ],
'required' => false,
'is_search_criterion' => true,
'title' => __( 'Rooms (min/max)', 'immonex-notify' ),
'min_max' => [
'default' => [ 0, 5 ],
'room' => [ 0, 1 ],
'house' => [ 0, 8 ],
'house_single' => [ 0, 8 ],
'house_multi' => [ 0, 16 ],
],
],
'price' => [
'scope' => [ 'all' ],
'required' => false,
'is_search_criterion' => true,
'title' => __( 'Price Range', 'immonex-notify' ),
'min_max' => [
'default' => [ 0, 500000 ],
'sale' => [ 0, 500000 ],
'sale,house_multi' => [ 0, 1500000 ],
'sale,office' => [ 0, 2000000 ],
'sale,retail' => [ 0, 2000000 ],
'sale,gastro_hotel' => [ 0, 5000000 ],
'sale,storage_prod' => [ 0, 5000000 ],
'rent_lease' => [ 0, 3500 ],
'rent_lease,flat' => [ 0, 2000 ],
'rent_lease,office' => [ 0, 5000 ],
'rent_lease,retail' => [ 0, 5000 ],
'rent_lease,storage_prod' => [ 0, 5000 ],
],
],
];
Original-Array ($scope
= compact, $keys_only
= true):
$elements = [
'email',
'property_type',
'marketing_type',
'location',
'distance_radius',
];
Code-Beispiel
/**
* [immonex Notify] Filter: Keys der Elemente des Suchformulars abrufen
* (kompakte Version).
*/
$form_element_keys = apply_filters( 'immonex_notify_request_form_elements', [], 'compact', true );