Esempio n. 1
0
st_the_language('user_create_hotel_location');
?>
:</label>

                            <div id="setting_multi_location" class="location-front">
                                <select placeholder="<?php 
echo __('Select location...', ST_TEXTDOMAIN);
?>
" tabindex="-1" name="multi_location[]" id="multi_location" class="option-tree-ui-select list-item-post-type" data-post-type="location">
                                   <option value=""><?php 
echo __('Select a location', ST_TEXTDOMAIN);
?>
</option> 
                                   <?php 
$locations = TravelHelper::getLocationBySession();
$html_location = TravelHelper::treeLocationHtml($locations, 0);
if (is_array($html_location) && count($html_location)) {
    foreach ($html_location as $key => $value) {
        $id = preg_replace("/(\\_)/", "", $value['ID']);
        ?>
      
                                        <option value="<?php 
        echo $value['ID'];
        ?>
"><?php 
        echo $value['prefix'] . get_the_title($id);
        ?>
</option>
                                    <?php 
    }
}
    function ot_type_list_item_post_type($args = array())
    {
        $st_custom_ot = new ST_List_Item_Post_Type();
        $url = $st_custom_ot->url;
        $default = array('field_post_type' => 'location', 'field_desc' => 'Location');
        $args = wp_parse_args($args, $default);
        extract($args);
        $post_type = $field_post_type;
        /* verify a description */
        $has_desc = $field_desc ? true : false;
        echo '<div class="format-setting type-post_select_ajax ' . ($has_desc ? 'has-desc' : 'no-desc') . '">';
        echo balanceTags($has_desc ? '<div class="description">' . htmlspecialchars_decode($field_desc) . '</div>' : '');
        echo '<div class="format-setting-inner">';
        $pl_name = '';
        $pl_desc = '';
        if ($field_value) {
            $pl_name = get_the_title($field_value);
            $pl_desc = "ID: " . get_the_ID($field_value);
        }
        $post_type_json = $post_type;
        $locations = TravelHelper::getLocationBySession();
        $html_location = TravelHelper::treeLocationHtml($locations, 0);
        echo '<select placeholder="' . __("Select item...", ST_TEXTDOMAIN) . '" tabindex="-1" name="' . esc_attr($field_name) . '[]" id="' . esc_attr($field_id) . '" class="option-tree-ui-select list-item-post-type" data-post-type="' . $post_type_json . '">';
        if (is_array($html_location) && count($html_location)) {
            foreach ($html_location as $key => $value) {
                $id = preg_replace("/(\\_)/", "", $value['ID']);
                ?>
      
            <option value="<?php 
                echo $value['ID'];
                ?>
"><?php 
                echo $value['prefix'] . get_the_title($id);
                ?>
</option>
        <?php 
            }
        }
        echo '</select>';
        echo '</div>';
        echo '</div>';
    }