我正在使用Aqua页面生成器,我想为此合并下拉分类选择字段。
<?php
$my_options = array (\'one\' => \'My Pony\',\'two\' => \'His Pony\');
echo aq_field_select(\'categories\', $block_id, $my_options, $categories);
?>
我试过了
$my_options= get_categories();
但它不起作用。功能基本上
function aq_field_select($field_id, $block_id, $options, $selected) {
$options = is_array($options) ? $options : array();
$output = \'<select id="\'. $block_id .\'_\'.$field_id.\'" name="aq_blocks[\'.$block_id.\'][\'.$field_id.\']">\';
foreach($options as $key=>$value) {
$output .= \'<option value="\'.$key.\'" \'.selected( $selected, $key, false ).\'>\'.htmlspecialchars($value).\'</option>\';
}
$output .= \'</select>\';
return $output;
}
谢谢你。