Don't show a check box for deleting the default category.

git-svn-id: https://develop.svn.wordpress.org/trunk@7329 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Peter Westwood 2008-03-16 10:00:11 +00:00
parent 4557a4440f
commit 6110e21411
1 changed files with 9 additions and 5 deletions

View File

@ -43,7 +43,6 @@ function _cat_row( $category, $level, $name_override = false ) {
$pad = str_repeat( '— ', $level ); $pad = str_repeat( '— ', $level );
if ( current_user_can( 'manage_categories' ) ) { if ( current_user_can( 'manage_categories' ) ) {
$edit = "<a class='row-title' href='categories.php?action=edit&amp;cat_ID=$category->term_id'>". ( $name_override ? $name_override : $pad . ' ' . $category->name ) ."</a>"; $edit = "<a class='row-title' href='categories.php?action=edit&amp;cat_ID=$category->term_id'>". ( $name_override ? $name_override : $pad . ' ' . $category->name ) ."</a>";
$default_cat_id = (int) get_option( 'default_category' );
} else { } else {
$edit = ( $name_override ? $name_override : $pad . ' ' . $category->name ); $edit = ( $name_override ? $name_override : $pad . ' ' . $category->name );
} }
@ -53,8 +52,13 @@ function _cat_row( $category, $level, $name_override = false ) {
$category->count = number_format_i18n( $category->count ); $category->count = number_format_i18n( $category->count );
$posts_count = ( $category->count > 0 ) ? "<a href='edit.php?cat=$category->term_id'>$category->count</a>" : $category->count; $posts_count = ( $category->count > 0 ) ? "<a href='edit.php?cat=$category->term_id'>$category->count</a>" : $category->count;
$output = "<tr id='cat-$category->term_id'$class> $output = "<tr id='cat-$category->term_id'$class>
<th scope='row' class='check-column'><input type='checkbox' name='delete[]' value='$category->term_id' /></th> <th scope='row' class='check-column'>";
<td>$edit</td> if ( absint(get_option( 'default_category' ) ) != $category->term_id ) {
$output .= "<input type='checkbox' name='delete[]' value='$category->term_id' /></th>";
} else {
$output .= "&nbsp;";
}
$output .= "<td>$edit</td>
<td>$category->description</td> <td>$category->description</td>
<td class='num'>$posts_count</td>\n\t</tr>\n"; <td class='num'>$posts_count</td>\n\t</tr>\n";