我一直在努力解决这个功能,我希望我有足够的尊重来提供赏金。帮助将不胜感激。
// Advanced Search Check
function ct_search_form_check($name, $taxonomy_name = null) {
global $search_values;
if (!$taxonomy_name) {
$taxonomy_name = $name;
} ?>
<?php foreach( get_terms($taxonomy_name, 'hide_empty=0') as $t) : ?>
<?php if ($search_values[$name] == $t->slug) { $selected = 'checked="checked"'; } else { $selected = ''; } ?>
<div><input id="ct_<?php echo $name; ?>" name="ct_<?php echo $name; ?>" type="checkbox" style="margin-right:5px; margin-left:5px" <?php echo $selected; ?>value="<?php echo $t->slug; ?>"><?php echo $t->name; ?><span style="margin-left:10px"></span></input></div>
//recently added this part to replace duplicate taxonomy_name in url
<?php $data = array();
while (list($name, $t->slug) = each($arr)) {
$data[] = "$name";
}
echo implode($data); ?>
<?php endforeach; ?>
<?php
}
如何更改我的输出
?ct_zipcode=&ct_event_type=校友&ct_=anneverisy&ct_setting=ballroom&ct_=酒吧&场地搜索=true
至
?ct_zipcode=&ct_event_type=alumni%2canneverisy&ct_setting=ballroom%2cbar&Venue-search=true