if(isset($_GET[\'get_tags\'])):
$output = array();
foreach(get_terms(\'post_tag\') as $key => $term):
// filter by $_GET[\'q\'] here if you need to,
// for eg. if(strpos($term->name, $_GET[\'q\']) !== false)...
$output[$key][\'value\'] = $key;
$output[$key][\'name\'] = $term->name;
endforeach;
header("Content-type: application/json");
echo json_encode($output);
die();
endif;
在这种情况下,您的js将类似于:
$("#input_1_3").autoSuggest(
"http://yoursite.com/?get_tags=1",
{selectedItemProp: "name", searchObjProps: "name"});