Skip to content

Commit

Permalink
Ensure we have the default category id. Fixes #5150 for branches/2.3
Browse files Browse the repository at this point in the history
git-svn-id: https://develop.svn.wordpress.org/branches/2.3@6194 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
westi committed Oct 6, 2007
1 parent 96fe646 commit e52c346
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions wp-admin/includes/template.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ function _cat_row( $category, $level, $name_override = false ) {
if ( current_user_can( 'manage_categories' ) ) {
$edit = "<a href='categories.php?action=edit&amp;cat_ID=$category->term_id' class='edit'>".__( 'Edit' )."</a></td>";
$default_cat_id = (int) get_option( 'default_category' );
$default_link_cat_id = (int) get_option( 'default_link_category' );

if ( $category->term_id != $default_cat_id )
$edit .= "<td><a href='" . wp_nonce_url( "categories.php?action=delete&amp;cat_ID=$category->term_id", 'delete-category_' . $category->term_id ) . "' onclick=\"return deleteSomething( 'cat', $category->term_id, '" . js_escape(sprintf( __("You are about to delete the category '%s'.\nAll posts that were only assigned to this category will be assigned to the '%s' category.\nAll links that were only assigned to this category will be assigned to the '%s' category.\n'OK' to delete, 'Cancel' to stop." ), $category->name, get_catname( $default_cat_id ), get_catname( $default_link_cat_id ) )) . "' );\" class='delete'>".__( 'Delete' )."</a>";
Expand Down

0 comments on commit e52c346

Please sign in to comment.