Danny,这几乎是直接从我制作的插件中提取的:
 <?php function form($instance){    
    $instance = wp_parse_args( (array) $instance, $this->w_arg );
  ?>
  <p>
    <select id="<?php echo $this->get_field_id(\'order\'); ?>" name="<?php echo $this->get_field_name(\'order\'); ?>" type="text">
        <option value="asc" <?php selected($instance[\'order\'], \'asc\'); ?>>ASC </option>
        <option value="desc" <?php selected($instance[\'order\'], \'desc\');?>>DESC </option>
    </select>
</p>
<?php
  }
?>
 在没有看到其余代码的情况下,我无法确定问题的根源,但可能是表单没有包装在表单函数中。如果上述内容似乎对您不起作用,也许可以粘贴您的Widget类?
我应该补充一点,我的widget类有一个变量w_arg, 默认值数组!E、 g。
var $w_arg = array(
        \'order\'=> \'ASC\'
        );