Make WordPress Core

Ticket #3176: 3176.if.diff

File 3176.if.diff, 2.2 KB (added by Sewar, 18 years ago)

Using if

  • admin-functions.php

     
    738738                $default_cat_id = get_option('default_category');
    739739                $default_link_cat_id = get_option('default_link_category');
    740740
    741                 if ( ($category->cat_ID != $default_cat_id) && ($category->cat_ID != $default_link_cat_id) )
    742                         $edit .= "<td><a href='" . wp_nonce_url("categories.php?action=delete&amp;cat_ID=$category->cat_ID", 'delete-category_' . $category->cat_ID ) . "' onclick=\"return deleteSomething( 'cat', $category->cat_ID, '" . sprintf(__("You are about to delete the category &quot;%s&quot;.\\nAll of its posts will go into the default category of &quot;%s&quot;\\nAll of its bookmarks will go into the default category of &quot;%s&quot;.\\n&quot;OK&quot; to delete, &quot;Cancel&quot; to stop."), js_escape($category->cat_name), js_escape(get_catname($default_cat_id)), js_escape(get_catname($default_link_cat_id))) . "' );\" class='delete'>".__('Delete')."</a>";
    743                 else
    744                         $edit .= "<td style='text-align:center'>".__("Default");
    745         } else
     741                if ($category->cat_ID == $default_cat_id) {
     742                        $edit .= "<td style='text-align:center'>".__("Default posts category");
     743                } elseif ($category->cat_ID == $default_link_cat_id) {
     744                        $edit .= "<td style='text-align:center'>".__("Default links category");
     745                } else {
     746                        $edit .= "<td style='text-align:center'><a href='" . wp_nonce_url("categories.php?action=delete&amp;cat_ID=$category->cat_ID", 'delete-category_' . $category->cat_ID ) . "' onclick=\"return deleteSomething( 'cat', $category->cat_ID, '" . sprintf(__("You are about to delete the category &quot;%s&quot;.\\nAll of its posts will go into the default category of &quot;%s&quot;\\nAll of its bookmarks will go into the default category of &quot;%s&quot;.\\n&quot;OK&quot; to delete, &quot;Cancel&quot; to stop."), js_escape($category->cat_name), js_escape(get_catname($default_cat_id)), js_escape(get_catname($default_link_cat_id))) . "' );\" class='delete'>".__('Delete')."</a>";
     747                }
     748        } else {
    746749                $edit = '';
     750        }
    747751
    748752        $class = ( ( defined('DOING_AJAX') && DOING_AJAX ) || " class='alternate'" == $class ) ? '' : " class='alternate'";
    749753