Make WordPress Core

Changeset 4156


Ignore:
Timestamp:
09/01/2006 08:38:24 PM (20 years ago)
Author:
ryan
Message:

Use wp_dropdown_categories(). Fix padding. Don't allow a cat to be it's own parent. Props westi. fixes #3088

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/admin-db.php

    r4112 r4156  
    109109
    110110    $category_parent = (int) $category_parent;
    111     if ( empty($category_parent) || !get_category( $category_parent ) )
     111    if ( empty($category_parent) || !get_category( $category_parent ) || $category_parent == $cat_ID )
    112112        $category_parent = 0;
    113113
  • trunk/wp-admin/edit-category-form.php

    r3804 r4156  
    3333            <th scope="row" valign="top"><label for="category_parent"><?php _e('Category parent:') ?></label></th>
    3434            <td>       
    35             <select name='category_parent' id='category_parent'>
    36       <option value='0' <?php if (!$category->category_parent) echo " selected='selected'"; ?>><?php _e('None') ?></option>
    37       <?php wp_dropdown_cats($category->cat_ID, $category->category_parent); ?>
    38       </select></td>
     35                <?php wp_dropdown_categories('hide_empty=0&name=category_parent&selected=' . $category->category_parent . '&hierarchical=1&show_option_none=' . __('None')); ?>
     36            </td>
    3937        </tr>
    4038        <tr>
  • trunk/wp-includes/classes.php

    r4144 r4156  
    697697            $output .= ' selected="selected"';
    698698        $output .= '>';
    699         $output .= $cat_name;
     699        $output .= $pad.$cat_name;
    700700        if ( $args['show_count'] )
    701701            $output .= '&nbsp;&nbsp;('. $category->category_count .')';
Note: See TracChangeset for help on using the changeset viewer.