Fix default cat options. see #4189

git-svn-id: https://develop.svn.wordpress.org/trunk@5562 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2007-05-27 17:57:15 +00:00
parent 668f977343
commit d002dd601f
1 changed files with 6 additions and 5 deletions

View File

@ -31,11 +31,11 @@ include('admin-header.php');
<th scope="row"><?php _e('Default post category:') ?></th>
<td><select name="default_category" id="default_category">
<?php
$categories = $wpdb->get_results("SELECT * FROM $wpdb->categories ORDER BY cat_name");
$categories = get_categories('get=all');
foreach ($categories as $category) :
if ($category->cat_ID == get_option('default_category')) $selected = " selected='selected'";
if ($category->term_id == get_option('default_category')) $selected = " selected='selected'";
else $selected = '';
echo "\n\t<option value='$category->cat_ID' $selected>$category->cat_name</option>";
echo "\n\t<option value='$category->term_id' $selected>$category->name</option>";
endforeach;
?>
</select></td>
@ -44,10 +44,11 @@ endforeach;
<th scope="row"><?php _e('Default link category:') ?></th>
<td><select name="default_link_category" id="default_link_category">
<?php
$categories = get_terms('link_category', 'get=all');
foreach ($categories as $category) :
if ($category->cat_ID == get_option('default_link_category')) $selected = " selected='selected'";
if ($category->term_id == get_option('default_link_category')) $selected = " selected='selected'";
else $selected = '';
echo "\n\t<option value='$category->cat_ID' $selected>$category->cat_name</option>";
echo "\n\t<option value='$category->term_id' $selected>$category->name</option>";
endforeach;
?>
</select></td>