本文整理汇总了PHP中TravelHelper::build_url_array方法的典型用法代码示例。如果您正苦于以下问题:PHP TravelHelper::build_url_array方法的具体用法?PHP TravelHelper::build_url_array怎么用?PHP TravelHelper::build_url_array使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TravelHelper
的用法示例。
在下文中一共展示了TravelHelper::build_url_array方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_terms
break;
case "taxonomy":
$terms = get_terms($value->taxonomy);
$key = $value->taxonomy;
foreach ($terms as $key2 => $value2) {
$current = STInput::get('taxonomy');
if (isset($current[$key])) {
$current = $current[$value->taxonomy];
} else {
$current = '';
}
$checked = TravelHelper::checked_array(explode(',', $current), $value2->term_id);
if ($checked) {
$link = TravelHelper::build_url_array('taxonomy', $value->taxonomy, $value2->term_id, false);
} else {
$link = TravelHelper::build_url_array('taxonomy', $value->taxonomy, $value2->term_id);
}
?>
<div class="checkbox">
<label>
<input <?php
if ($checked) {
echo "checked";
}
?>
value="<?php
echo esc_attr($value2->term_id);
?>
" name="star_rate" data-url="<?php
echo esc_url($link);
?>
示例2:
if ($post_type == 'hotel_room') {
$name_field = "taxonomy_hotel_room";
} else {
$name_field = "taxonomy";
}
$current = STInput::get($name_field);
if (isset($current[$key])) {
$current = $current[$key];
} else {
$current = '';
}
$checked = TravelHelper::checked_array(explode(',', $current), $value2->term_id);
if ($checked) {
$link = TravelHelper::build_url_array($name_field, $key, $value2->term_id, false);
} else {
$link = TravelHelper::build_url_array($name_field, $key, $value2->term_id);
}
?>
<div class="checkbox">
<label>
<input <?php
if ($checked) {
echo "checked";
}
?>
value="<?php
echo esc_attr($value2->term_id);
?>
" name="" data-url="<?php
echo esc_url($link);
?>