Make WordPress Core

Changeset 3079


Ignore:
Timestamp:
11/14/2005 10:11:15 AM (20 years ago)
Author:
matt
Message:

These are not the categories you're looking for, fixes #1654

File:
1 edited

Legend:

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

    r3075 r3079  
    513513                $count = $wpdb->get_var("SELECT COUNT(post_id) FROM $wpdb->post2cat WHERE category_id = $category->cat_ID");
    514514                $pad = str_repeat('— ', $level);
    515                 if (current_user_can('manage_categories'))
    516                     $edit = "<a href='categories.php?action=edit&amp;cat_ID=$category->cat_ID' class='edit'>".__('Edit')."</a></td><td><a href='categories.php?action=delete&amp;cat_ID=$category->cat_ID' onclick=\"return deleteSomething( 'cat', $category->cat_ID, '".sprintf(__("You are about to delete the category &quot;%s&quot;.  All of its posts will go to the default category.\\n&quot;OK&quot; to delete, &quot;Cancel&quot; to stop."), wp_specialchars($category->cat_name, 1))."' );\" class='delete'>".__('Delete')."</a>";
     515                if ( current_user_can('manage_categories') ) {
     516                    $edit = "<a href='categories.php?action=edit&amp;cat_ID=$category->cat_ID' class='edit'>".__('Edit')."</a></td>";
     517                    $default_cat_id = get_option('default_category');
     518                   
     519                    if ($category->cat_ID != $default_cat_id)
     520                        $edit .= "<td><a href='categories.php?action=delete&amp;cat_ID=$category->cat_ID' onclick=\"return deleteSomething( 'cat', $category->cat_ID, '".sprintf(__("You are about to delete the category &quot;%s&quot;.  All of its posts will go to the default category.\\n&quot;OK&quot; to delete, &quot;Cancel&quot; to stop."), wp_specialchars($category->cat_name, 1))."' );\" class='delete'>".__('Delete')."</a>";
     521                    else
     522                        $edit .= "<td style='text-align:center'>".__("Default");
     523                }
    517524                else
    518525                    $edit = '';
Note: See TracChangeset for help on using the changeset viewer.