widget control form problem: works but then breaks after save
-
Hi, I am a little new to authoring widgets. I am working on a widget that displays images from a category you select. I have a dropdown list of categories. the problem I am having is that when you load the widget control panel, the dropdown is functional; it displays properly and you can sucessfully select a category. when you hit save, it does in fact save your selection, but then the dropdown list becomes an empty dropown with a single blank item. When you refresh, it loads properly again. I have no idea what is going on! Here is that chunk of my widget form code:
<p> <label for="<?php echo $this->get_field_id('whichCat'); ?>"> <select id="<?php echo $this->get_field_id('whichCat'); ?>" name="<?php echo $this->get_field_name('whichCat'); ?>" /> <?php //lets try and list some categories $categories = get_categories(); foreach ($categories as $cat) { //set up the option in the drop down echo "<option value=".$cat->slug.">"; echo $cat->name."</option>"; } ?> </select></label></p>
thanks!
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘widget control form problem: works but then breaks after save’ is closed to new replies.