Changeset 9757
- Timestamp:
- 11/18/2008 05:25:43 PM (12 years ago)
- Location:
- trunk/wp-admin
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/edit-link-categories.php
r9751 r9757 144 144 $output .= link_cat_row($category); 145 145 } 146 $output = apply_filters('cat_rows', $output);147 146 echo $output; 148 147 unset($category); -
trunk/wp-admin/includes/template.php
r9751 r9757 96 96 ob_end_clean(); 97 97 98 $output = apply_filters('cat_rows', $output);99 100 98 echo $output; 101 99 } … … 114 112 static $row_class; 115 113 116 $category = get_category( $category ); 117 $catname = sanitize_term_field( 'name', $category->name, $category->term_id, 'category', 'display' ); 118 $catdesc = sanitize_term_field( 'description', $category->description, $category->term_id, 'category', 'display' ); 119 $qe_name = sanitize_term_field( 'name', $category->name, $category->term_id, 'category', 'edit' ); 114 $category = get_category( $category, OBJECT, 'display' ); 120 115 121 116 $default_cat_id = (int) get_option( 'default_category' ); 122 117 $pad = str_repeat( '— ', $level ); 123 $name = ( $name_override ? $name_override : $pad . ' ' . $cat name );118 $name = ( $name_override ? $name_override : $pad . ' ' . $category->name ); 124 119 $edit_link = "categories.php?action=edit&cat_ID=$category->term_id"; 125 120 if ( current_user_can( 'manage_categories' ) ) { 126 $edit = "<a class='row-title' href='$edit_link' title='" . attribute_escape(sprintf(__('Edit "%s"'), $cat name)) . "'>" . attribute_escape( $name ) . '</a><br />';121 $edit = "<a class='row-title' href='$edit_link' title='" . attribute_escape(sprintf(__('Edit "%s"'), $category->name)) . "'>" . attribute_escape( $name ) . '</a><br />'; 127 122 $actions = array(); 128 123 $actions['edit'] = '<a href="' . $edit_link . '">' . __('Edit') . '</a>'; … … 142 137 143 138 $row_class = 'alternate' == $row_class ? '' : 'alternate'; 139 $qe_data = get_category_to_edit($category->term_id); 140 144 141 $category->count = number_format_i18n( $category->count ); 145 142 $posts_count = ( $category->count > 0 ) ? "<a href='edit.php?cat=$category->term_id'>$category->count</a>" : $category->count; … … 169 166 case 'name': 170 167 $output .= "<td $attributes>$edit"; 171 $output .= '<div class="hidden" id="inline_' . $ category->term_id . '">';172 $output .= '<div class="name">' . $qe_ name . '</div>';173 $output .= '<div class="slug">' . $ category->slug . '</div>';174 $output .= '<div class="cat_parent">' . $ category->parent . '</div></div></td>';168 $output .= '<div class="hidden" id="inline_' . $qe_data->term_id . '">'; 169 $output .= '<div class="name">' . $qe_data->name . '</div>'; 170 $output .= '<div class="slug">' . $qe_data->slug . '</div>'; 171 $output .= '<div class="cat_parent">' . $qe_data->parent . '</div></div></td>'; 175 172 break; 176 173 case 'description': 177 $output .= "<td $attributes>$cat desc</td>";174 $output .= "<td $attributes>$category->description</td>"; 178 175 break; 179 176 case 'slug': … … 187 184 $output .= '</tr>'; 188 185 189 return apply_filters('cat_row', $output);186 return $output; 190 187 } 191 188 … … 275 272 global $class; 276 273 277 if ( !$category = get_term( $category, 'link_category' ) )274 if ( !$category = get_term( $category, 'link_category', OBJECT, 'display' ) ) 278 275 return false; 279 276 if ( is_wp_error( $category ) ) 280 277 return $category; 281 278 282 $catname = sanitize_term_field( 'name', $category->name, $category->term_id, 'category', 'display' );283 $catdesc = sanitize_term_field( 'description', $category->description, $category->term_id, 'category', 'display' );284 $qe_name = sanitize_term_field( 'name', $category->name, $category->term_id, 'category', 'edit' );285 286 279 $default_cat_id = (int) get_option( 'default_link_category' ); 287 $name = ( $name_override ? $name_override : $cat name );280 $name = ( $name_override ? $name_override : $category->name ); 288 281 $edit_link = "link-category.php?action=edit&cat_ID=$category->term_id"; 289 282 if ( current_user_can( 'manage_categories' ) ) { 290 $edit = "<a class='row-title' href='$edit_link' title='" . attribute_escape(sprintf(__('Edit "%s"'), $cat name)) . "'>$name</a><br />";283 $edit = "<a class='row-title' href='$edit_link' title='" . attribute_escape(sprintf(__('Edit "%s"'), $category->name)) . "'>$name</a><br />"; 291 284 $actions = array(); 292 285 $actions['edit'] = '<a href="' . $edit_link . '">' . __('Edit') . '</a>'; … … 306 299 307 300 $class = 'alternate' == $class ? '' : 'alternate'; 301 $qe_data = get_term_to_edit($category->term_id, 'link_category'); 302 308 303 $category->count = number_format_i18n( $category->count ); 309 304 $count = ( $category->count > 0 ) ? "<a href='link-manager.php?cat_id=$category->term_id'>$category->count</a>" : $category->count; … … 332 327 case 'name': 333 328 $output .= "<td $attributes>$edit"; 334 $output .= '<div class="hidden" id="inline_' . $ category->term_id . '">';335 $output .= '<div class="name">' . $qe_ name . '</div>';336 $output .= '<div class="slug">' . $ category->slug . '</div>';337 $output .= '<div class="cat_parent">' . $ category->parent . '</div></div></td>';329 $output .= '<div class="hidden" id="inline_' . $qe_data->term_id . '">'; 330 $output .= '<div class="name">' . $qe_data->name . '</div>'; 331 $output .= '<div class="slug">' . $qe_data->slug . '</div>'; 332 $output .= '<div class="cat_parent">' . $qe_data->parent . '</div></div></td>'; 338 333 break; 339 334 case 'description': 340 $output .= "<td $attributes>$cat desc</td>";335 $output .= "<td $attributes>$category->description</td>"; 341 336 break; 342 337 case 'links': … … 347 342 $output .= '</tr>'; 348 343 349 return apply_filters( 'link_cat_row', $output );344 return $output; 350 345 } 351 346 … … 580 575 */ 581 576 function _tag_row( $tag, $class = '' ) { 582 583 577 $count = number_format_i18n( $tag->count ); 584 578 $count = ( $count > 0 ) ? "<a href='edit.php?tag=$tag->slug'>$count</a>" : $count; 585 $tagname = sanitize_term_field( 'name', $tag->name, $tag->term_id, 'tag', 'display' ); 586 $ qe_name = sanitize_term_field( 'name', $tag->name, $tag->term_id, 'tag', 'edit');587 579 580 $name = apply_filters( 'term_name', $tag->name ); 581 $qe_data = get_term($tag->term_id, 'post_tag', object, 'edit'); 588 582 $edit_link = "edit-tags.php?action=edit&tag_ID=$tag->term_id"; 589 583 $out = ''; … … 605 599 break; 606 600 case 'name': 607 $out .= '<td ' . $attributes . '><strong><a class="row-title" href="' . $edit_link . '" title="' . attribute_escape(sprintf(__('Edit "%s"'), $ tagname)) . '">' . $tagname . '</a></strong><br />';601 $out .= '<td ' . $attributes . '><strong><a class="row-title" href="' . $edit_link . '" title="' . attribute_escape(sprintf(__('Edit "%s"'), $name)) . '">' . $name . '</a></strong><br />'; 608 602 $actions = array(); 609 603 $actions['edit'] = '<a href="' . $edit_link . '">' . __('Edit') . '</a>'; … … 617 611 $out .= "<span class='$action'>$link$sep</span>"; 618 612 } 619 $out .= '<div class="hidden" id="inline_' . $ tag->term_id . '">';620 $out .= '<div class="name">' . $qe_ name . '</div>';621 $out .= '<div class="slug">' . $ tag->slug . '</div></div></td>';613 $out .= '<div class="hidden" id="inline_' . $qe_data->term_id . '">'; 614 $out .= '<div class="name">' . $qe_data->name . '</div>'; 615 $out .= '<div class="slug">' . $qe_data->slug . '</div></div></td>'; 622 616 break; 623 617 case 'slug': … … 669 663 670 664 // filter and send to screen 671 $out = apply_filters('tag_rows', $out);672 665 echo $out; 673 666 return $count;
Note: See TracChangeset
for help on using the changeset viewer.