WordPress 3 ampersand in category name
-
I am creating an options page for a site I am building and I have hit a problem that I have not noticed before and that is when selecting a category that has an ampersand (&) in the category name it will not show the correctly selected category when going back to the options page.
Is there a way around this?
I have tried using&
but i guess as it contains the & it still errors.This is for an options page, so I am using:
$categories_list = get_categories('hide_empty=0'); $categories = array(); foreach ($categories_list as $catlist) { $categories[$catlist->cat_ID] = $catlist->cat_name; } array_unshift($categories, "Choose a category");
then
case 'select': ?> <div class="tfh_input tfh_select"> <label for="<?php echo $value['id']; ?>"><?php echo $value['name']; ?></label> <select name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>"> <?php foreach ($value['options'] as $option) { ?> <option <?php if ( get_settings( $value['id'] ) == $option) { echo ' selected="selected"'; } elseif ($option == $value['std']) { echo ' selected="selected"'; } ?>><?php echo $option; ?></option><?php } ?> </select> <small><?php echo $value['desc']; ?></small> <div class="clearfix"></div> </div> <?php break;
which i think is pretty standard?
Any ideas on how i can around this so it still works with the ampersand in the category name or is this a bug?
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘WordPress 3 ampersand in category name’ is closed to new replies.