WordPress.org

Make WordPress Core

Changeset 5562


Ignore:
Timestamp:
05/27/2007 05:57:15 PM (15 years ago)
Author:
ryan
Message:

Fix default cat options. see #4189

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/options-writing.php

    r4977 r5562  
    3232<td><select name="default_category" id="default_category">
    3333<?php
    34 $categories = $wpdb->get_results("SELECT * FROM $wpdb->categories ORDER BY cat_name");
     34$categories = get_categories('get=all');
    3535foreach ($categories as $category) :
    36 if ($category->cat_ID == get_option('default_category')) $selected = " selected='selected'";
     36if ($category->term_id == get_option('default_category')) $selected = " selected='selected'";
    3737else $selected = '';
    38 echo "\n\t<option value='$category->cat_ID' $selected>$category->cat_name</option>";
     38echo "\n\t<option value='$category->term_id' $selected>$category->name</option>";
    3939endforeach;
    4040?>
     
    4545<td><select name="default_link_category" id="default_link_category">
    4646<?php
     47$categories = get_terms('link_category', 'get=all');
    4748foreach ($categories as $category) :
    48 if ($category->cat_ID == get_option('default_link_category')) $selected = " selected='selected'";
     49if ($category->term_id == get_option('default_link_category')) $selected = " selected='selected'";
    4950else $selected = '';
    50 echo "\n\t<option value='$category->cat_ID' $selected>$category->cat_name</option>";
     51echo "\n\t<option value='$category->term_id' $selected>$category->name</option>";
    5152endforeach;
    5253?>
Note: See TracChangeset for help on using the changeset viewer.