本文整理汇总了PHP中TravelHelper::treeLocationHtml方法的典型用法代码示例。如果您正苦于以下问题:PHP TravelHelper::treeLocationHtml方法的具体用法?PHP TravelHelper::treeLocationHtml怎么用?PHP TravelHelper::treeLocationHtml使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TravelHelper
的用法示例。
在下文中一共展示了TravelHelper::treeLocationHtml方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: st_the_language
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
}
}
示例2: 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>';
}