当前位置: 首页>>代码示例>>PHP>>正文


PHP TravelHelper::getLocationBySession方法代码示例

本文整理汇总了PHP中TravelHelper::getLocationBySession方法的典型用法代码示例。如果您正苦于以下问题:PHP TravelHelper::getLocationBySession方法的具体用法?PHP TravelHelper::getLocationBySession怎么用?PHP TravelHelper::getLocationBySession使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TravelHelper的用法示例。


在下文中一共展示了TravelHelper::getLocationBySession方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: ot_type_list_item_post_type

    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>';
    }
开发者ID:DaddyFool,项目名称:travelTest,代码行数:42,代码来源:st-list-item-post-type.php

示例2: st_the_language

                            <label for="multi_location"><?php 
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 
    }
开发者ID:DaddyFool,项目名称:travelTest,代码行数:31,代码来源:user-edit-hotel.php


注:本文中的TravelHelper::getLocationBySession方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。