Changeset 8911 for trunk/wp-admin/includes/template.php
- Timestamp:
- 09/17/2008 12:11:17 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/template.php
r8910 r8911 79 79 $category = get_category( $category ); 80 80 81 $default_cat_id = (int) get_option( 'default_category' ); 81 82 $pad = str_repeat( '— ', $level ); 82 83 $name = ( $name_override ? $name_override : $pad . ' ' . $category->name ); … … 86 87 $actions = array(); 87 88 $actions['edit'] = '<a href="' . $edit_link . '">' . __('Edit') . '</a>'; 88 $actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url("categories.php?action=delete&cat_ID=$category->term_id", 'delete-category_' . $category->term_id) . "' onclick=\"if ( confirm('" . js_escape(sprintf(__("You are about to delete this category '%s'\n 'Cancel' to stop, 'OK' to delete."), $name )) . "') ) { return true;}return false;\">" . __('Delete') . "</a>"; 89 if ( $default_cat_id != $category->term_id ) 90 $actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url("categories.php?action=delete&cat_ID=$category->term_id", 'delete-category_' . $category->term_id) . "' onclick=\"if ( confirm('" . js_escape(sprintf(__("You are about to delete this category '%s'\n 'Cancel' to stop, 'OK' to delete."), $name )) . "') ) { return true;}return false;\">" . __('Delete') . "</a>"; 89 91 $action_count = count($actions); 90 92 $i = 0; … … 104 106 $output = "<tr id='cat-$category->term_id'$class> 105 107 <th scope='row' class='check-column'>"; 106 if ( absint(get_option( 'default_category' ) )!= $category->term_id ) {108 if ( $default_cat_id != $category->term_id ) { 107 109 $output .= "<input type='checkbox' name='delete[]' value='$category->term_id' />"; 108 110 } else { … … 125 127 return $category; 126 128 129 $default_cat_id = (int) get_option( 'default_link_category' ); 127 130 $name = ( $name_override ? $name_override : $category->name ); 131 $edit_link = "link-category.php?action=edit&cat_ID=$category->term_id"; 128 132 if ( current_user_can( 'manage_categories' ) ) { 129 $edit = "<a class='row-title' href='link-category.php?action=edit&cat_ID=$category->term_id' title='" . attribute_escape(sprintf(__('Edit "%s"'), $category->name)) . "'>$name</a>"; 130 $default_cat_id = (int) get_option( 'default_link_category' ); 133 $edit = "<a class='row-title' href='$edit_link' title='" . attribute_escape(sprintf(__('Edit "%s"'), $category->name)) . "'>$name</a><br />"; 134 $actions = array(); 135 $actions['edit'] = '<a href="' . $edit_link . '">' . __('Edit') . '</a>'; 136 if ( $default_cat_id != $category->term_id ) 137 $actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url("link-category.php?action=delete&cat_ID=$category->term_id", 'delete-link-category_' . $category->term_id) . "' onclick=\"if ( confirm('" . js_escape(sprintf(__("You are about to delete this category '%s'\n 'Cancel' to stop, 'OK' to delete."), $name )) . "') ) { return true;}return false;\">" . __('Delete') . "</a>"; 138 $action_count = count($actions); 139 $i = 0; 140 foreach ( $actions as $action => $link ) { 141 ++$i; 142 ( $i == $action_count ) ? $sep = '' : $sep = ' | '; 143 $edit .= "<span class='$action'>$link$sep</span>"; 144 } 131 145 } else { 132 146 $edit = $name;
Note: See TracChangeset
for help on using the changeset viewer.