/**
     * Display custom column for properties
     *
     * @access  public
     * @param   string $column_name
     * @since   1.0.0
     * @return  void
     */
    public function display_custom_column($column_name)
    {
        global $post;
        switch ($column_name) {
            case 'thumb':
                if (has_post_thumbnail($post->ID)) {
                    ?>
<a href="<?php 
                    the_permalink();
                    ?>
" target="_blank"><?php 
                    the_post_thumbnail(array(130, 130));
                    ?>
</a><?php 
                } else {
                    _e('No Image', 'inspiry-real-estate');
                }
                break;
            case 'id':
                $property_id = get_post_meta($post->ID, 'REAL_HOMES_property_id', true);
                if (!empty($property_id)) {
                    echo $property_id;
                } else {
                    _e('NA', 'inspiry-real-estate');
                }
                break;
            case 'price':
                $property_price = get_post_meta($post->ID, 'REAL_HOMES_property_price', true);
                if (!empty($property_price)) {
                    $price_amount = doubleval($property_price);
                    $price_postfix = get_post_meta($post->ID, 'REAL_HOMES_property_price_postfix', true);
                    echo Inspiry_Property::format_price($price_amount, $price_postfix);
                } else {
                    _e('NA', 'inspiry-real-estate');
                }
                break;
            default:
                break;
        }
    }
예제 #2
0
 /**
  * Output options for maximum price select box in property search form
  */
 function inspiry_maximum_prices_options()
 {
     global $inspiry_options;
     $max_prices = array(5000, 10000, 50000, 100000, 200000, 300000, 400000, 500000, 600000, 700000, 800000, 900000, 1000000, 1500000, 2000000, 2500000, 5000000, 10000000);
     // Get values from theme options and convert them to an integer array
     $inspiry_max_prices = $inspiry_options['inspiry_maximum_prices'];
     if (!empty($inspiry_max_prices)) {
         $max_prices_strs = explode(',', $inspiry_max_prices);
         if (is_array($max_prices_strs) && !empty($max_prices_strs)) {
             $new_max_prices = array();
             foreach ($max_prices_strs as $price_str) {
                 $price_num = doubleval($price_str);
                 if ($price_num > 1) {
                     $new_max_prices[] = $price_num;
                 }
             }
             if (!empty($new_max_prices)) {
                 $max_prices = $new_max_prices;
             }
         }
     }
     $maximum_price = '';
     if (isset($_GET['max-price'])) {
         $maximum_price = doubleval($_GET['max-price']);
     }
     if ($maximum_price == 'any' || empty($maximum_price)) {
         echo '<option value="any" selected="selected">' . __('Max Price (Any)', 'inspiry') . '</option>';
     } else {
         echo '<option value="any">' . __('Max Price (Any)', 'inspiry') . '</option>';
     }
     if (!empty($max_prices)) {
         foreach ($max_prices as $price) {
             if ($maximum_price == $price) {
                 echo '<option value="' . $price . '" selected="selected">' . Inspiry_Property::format_price($price) . '</option>';
             } else {
                 echo '<option value="' . $price . '">' . Inspiry_Property::format_price($price) . '</option>';
             }
         }
     }
 }