Using Wordpress I have created a multiple select box so that users can select categories to exclude. When the page initially loads I see my default values pre-selected. However when I select new values and save... I only see the word "Array" echoed and nothing selected?
<select class="amultiple" id="<?php echo $value['id']; ?>" name="<?php echo $value['id']; ?>[]" multiple="multiple" size="8">
<?php
global $options;
foreach ($options as $value) {
if (get_settings( $value['id'] ) === FALSE) { $$value['id'] = $value['std']; } else { $$value['id'] = get_settings( $value['id'] );
}
}
$categories = &get_categories('type=post&orderby=name&hide_empty=1');
if ($categories) {
$ex_cat = implode(',', $tt_cat_exclude);
foreach ($categories as $category) {
$selected = (in_array($ex_cat, $category->cat_ID)) ? ' selected="selected"' : '';
echo '<option value="' . $category->cat_ID . '"' . $selected . '>' . $category->cat_name . '</option>' . "\n";
}
}
?>
</select>
<br />For testing purposes, print variables: <?php echo $ex_cat; ?>