function add_shortcodes_post_init() { $features = PropertiesManager::getAllFeatures(); $features_array = array(); foreach ($features as $feature) { $features_array[$feature->name] = $feature->slug; } $types = PropertiesManager::getAllTypes(); $types_array = array(); foreach ($types as $type) { $types_array[$type->name] = $type->slug; } $cities = array('-' => ''); $_cities = estetico_get_all_cities(); foreach ($_cities as $_city) { $cities[$_city] = $_city; } unset($_cities, $_city); if (function_exists('vc_map')) { vc_map(array("name" => __('Properties', THEME_NAME), "base" => 'properties', 'category' => __('Estetico'), 'params' => array(array("type" => 'dropdown', 'param_name' => 'list_style', 'heading' => __('Style', THEME_NAME), "value" => array(__('Grid', THEME_NAME) => 'grid', __('List', THEME_NAME) => 'list', __('Carousel', THEME_NAME) => 'carousel', __('Map', THEME_NAME) => 'map', __('List + Map', THEME_NAME) => 'list_map', __('Grid + Map', THEME_NAME) => 'grid_map'), "description" => __('Choose the style your properties will be visualized to the visitors', THEME_NAME)), array("type" => 'dropdown', 'param_name' => 'sort_by', 'heading' => __('Sort by', THEME_NAME), "value" => array(__('None', THEME_NAME) => 'none', __('Price (low to high)', THEME_NAME) => 'price_low_to_high', __('Price (high to low)', THEME_NAME) => 'price_high_to_low', __('View count (low to high)', THEME_NAME) => 'view_count_low_to_high', __('View count (high to low)', THEME_NAME) => 'view_count_high_to_low', __('Date (low to high)', THEME_NAME) => 'date_low_to_high', __('Date (high to low)', THEME_NAME) => 'date_low_to_high'), "description" => __('Choose how to sort properties', THEME_NAME)), array("type" => 'textfield', 'param_name' => 'min_price', 'heading' => __('Price minimum', THEME_NAME)), array("type" => 'textfield', 'param_name' => 'max_price', 'heading' => __('Price maximum', THEME_NAME)), array("type" => 'textfield', 'param_name' => 'bedrooms_min', 'heading' => __('Bedrooms minimum', THEME_NAME)), array("type" => 'textfield', 'param_name' => 'bedrooms_max', 'heading' => __('Bedrooms maximum', THEME_NAME)), array("type" => 'textfield', 'param_name' => 'bathrooms_min', 'heading' => __('Bathrooms minimum', THEME_NAME)), array("type" => 'textfield', 'param_name' => 'bathrooms_max', 'heading' => __('Bathrooms maximum', THEME_NAME)), array("type" => 'textfield', 'param_name' => 'sq_feet', 'heading' => __('Sq. feet', THEME_NAME), 'description' => __('Will display properties will area equal or larger than this value', THEME_NAME)), array("type" => 'checkbox', 'param_name' => 'pets_allowed', 'heading' => __('Pets allowed', THEME_NAME), 'value' => array(__('Yes') => 'yes'), 'description' => __('Will show properties that have either pets allowed or not.', THEME_NAME)), array("type" => 'checkbox', 'param_name' => 'type', 'heading' => __('Type', THEME_NAME), 'value' => $types_array), array("type" => 'checkbox', 'param_name' => 'feature', 'heading' => __('Feature', THEME_NAME), 'value' => $features_array), array("type" => 'dropdown', 'param_name' => 'city', 'heading' => __('City', THEME_NAME), 'value' => $cities), array("type" => 'dropdown', 'param_name' => 'for_sale_rent', 'heading' => __('For sale or rent', THEME_NAME), 'value' => array('-' => '', __('Sale', THEME_NAME) => 'sale', __('Rent', THEME_NAME) => 'rent'), 'description' => __('If you don\'t choose an option both will be shown', THEME_NAME)), array("type" => 'dropdown', 'param_name' => 'property_status', 'heading' => __('Property status', THEME_NAME), 'value' => array('' => '', __('Sold', THEME_NAME) => 'sold', __('Rented', THEME_NAME) => 'rented', __('Let agreed', THEME_NAME) => 'let_agreed', __('Sale agreed', THEME_NAME) => 'sale_agreed')), array("type" => 'textfield', 'param_name' => 'lat', 'heading' => __('Latitude', THEME_NAME)), array("type" => 'textfield', 'param_name' => 'lng', 'heading' => __('Longitude', THEME_NAME)), array("type" => 'textfield', 'param_name' => 'distance', 'heading' => __('Distance', THEME_NAME)), array("type" => 'checkbox', 'param_name' => 'auto_slide', 'heading' => __('Auto slide', THEME_NAME), 'value' => array(__('Yes') => 'yes'), 'description' => __('Automatically slide properties in the carousel. It applies only for carousel style.', THEME_NAME)), array("type" => 'checkbox', 'param_name' => 'infinite_loop', 'heading' => __('Infinite slide', THEME_NAME), 'value' => array(__('Yes') => 'yes'), 'description' => __('Infinitely slide properties in the carousel. It applies only for carousel style.', THEME_NAME))))); } }
function estetico_get_quick_search_item($id) { $output = ''; $title = __(estetico_get_of_option_name('quick_search_items', $id), THEME_NAME); switch ($id) { case 'beds': $output = '<div class="styled-select">'; $output .= '<select name="' . $id . '">'; $output .= '<option value="">' . __('Beds', THEME_NAME) . '</option>'; for ($i = 1; $i <= 20; $i++) { $output .= '<option value="' . $i . '">' . $i . '+</option>'; } $output .= '</select>'; $output .= '</div>'; break; case 'pets_allowed': $output = '<div class="styled-select">'; $output .= '<select name="' . $id . '">'; $output .= '<option value="">' . __('Pets allowed', THEME_NAME) . '</option>'; $output .= '<option value="yes">' . __('Yes', THEME_NAME) . '</option>'; $output .= '<option value="no">' . __('No', THEME_NAME) . '</option>'; $output .= '</select>'; $output .= '</div>'; break; case 'for_sale_rent': $output = '<div class="styled-select">'; $output .= '<select name="' . $id . '">'; $output .= '<option value="">' . __('For sale or rent', THEME_NAME) . '</option>'; $output .= '<option value="sale">' . __('Sale', THEME_NAME) . '</option>'; $output .= '<option value="rent">' . __('Rent', THEME_NAME) . '</option>'; $output .= '<option value="both">' . __('Both', THEME_NAME) . '</option>'; $output .= '</select>'; $output .= '</div>'; break; case 'feature': $features = PropertiesManager::getAllFeatures(); $output = '<div class="styled-select"> <select name="' . $id . '"> <option value="">' . $title . '</option>'; foreach ($features as $feature) { $output .= '<option value="' . esc_attr($feature->slug) . '">' . esc_html($feature->name) . '</option>'; } $output .= ' </select> </div>'; break; case 'city': $cities = estetico_get_all_cities(); $output = '<div class="styled-select"> <select name="' . $id . '"> <option value="">' . $title . '</option>'; foreach ($cities as $city) { $output .= '<option value="' . esc_attr($city) . '">' . esc_html($city) . '</option>'; } $output .= ' </select> </div>'; break; case 'min_price': case 'max_price': $output = '<input type="text" name="' . $id . '" placeholder="' . esc_attr($title) . '" class="input text">'; break; case 'bedrooms': case 'bathrooms': $output = '<div class="styled-select"> <select name="' . $id . '"> <option value="">' . $title . '</option> <option value="1">1+</option> <option value="2">2+</option> <option value="3">3+</option> <option value="4">4+</option> <option value="5">5+</option> <option value="6">6+</option> </select> </div>'; break; case 'type': $output .= '<div class="styled-select"> <select name="' . $id . '"> <option value="">' . $title . '</option>'; $propMgr = new PropertiesManager(); $property_types = $propMgr->getPropertyTypes(); foreach ($property_types as $type) { $output .= '<option value="' . $type->slug . '">' . $type->name . '</option>'; } $output .= '</select></div>'; break; } return $output; }
<?php break; case 'city': ?> <div class="filter-group"> <h4><?php echo __('City', THEME_NAME); ?> </h4> <div class="styled-select"> <select name="city"> <option value="">-</option> <?php $cities = estetico_get_all_cities(); foreach ($cities as $_city) { ?> <option value="<?php echo esc_attr($_city); ?> "<?php if (isset($city) && $_city == $city) { ?> selected="selected"<?php } ?> ><?php echo esc_html($_city); ?> </option>