Ticket #8146: catfiltering.diff
File catfiltering.diff, 4.3 KB (added by , 12 years ago) |
---|
-
opt/www/eclipsework/WPDev/wp-admin/edit-link-categories.php
141 141 if ( $categories ) { 142 142 $output = ''; 143 143 foreach ( $categories as $category ) { 144 $category = sanitize_term($category, 'link_category', 'display');145 144 $output .= link_cat_row($category); 146 145 } 147 $output = apply_filters('cat_rows', $output);148 146 echo $output; 149 147 unset($category); 150 148 } -
opt/www/eclipsework/WPDev/wp-admin/includes/template.php
95 95 $output = ob_get_contents(); 96 96 ob_end_clean(); 97 97 98 $output = apply_filters('cat_rows', $output);99 100 98 echo $output; 101 99 } 102 100 … … 114 112 global $class; 115 113 116 114 $category = get_category( $category ); 115 $catname = sanitize_term_field( 'name', $category->name, $category->term_id, 'category', 'display' ); 116 $catdesc = sanitize_term_field( 'description', $category->description, $category->term_id, 'category', 'display' ); 117 117 118 118 $default_cat_id = (int) get_option( 'default_category' ); 119 119 $pad = str_repeat( '— ', $level ); 120 $name = ( $name_override ? $name_override : $pad . ' ' . $cat egory->name );120 $name = ( $name_override ? $name_override : $pad . ' ' . $catname ); 121 121 $edit_link = "categories.php?action=edit&cat_ID=$category->term_id"; 122 122 if ( current_user_can( 'manage_categories' ) ) { 123 $edit = "<a class='row-title' href='$edit_link' title='" . attribute_escape(sprintf(__('Edit "%s"'), $cat egory->name)) . "'>" . attribute_escape( $name ) . '</a><br />';123 $edit = "<a class='row-title' href='$edit_link' title='" . attribute_escape(sprintf(__('Edit "%s"'), $catname)) . "'>" . attribute_escape( $name ) . '</a><br />'; 124 124 $actions = array(); 125 125 $actions['edit'] = '<a href="' . $edit_link . '">' . __('Edit') . '</a>'; 126 126 $actions['inline hide-if-no-js'] = '<a href="#" class="editinline">' . __('Quick Edit') . '</a>'; … … 173 173 $output .= '<div class="cat_parent">' . $qe_data->parent . '</div></div></td>'; 174 174 break; 175 175 case 'description': 176 $output .= "<td $attributes>$cat egory->description</td>";176 $output .= "<td $attributes>$catdesc</td>"; 177 177 break; 178 178 case 'slug': 179 179 $output .= "<td $attributes>$category->slug</td>"; … … 278 278 if ( is_wp_error( $category ) ) 279 279 return $category; 280 280 281 282 $catname = sanitize_term_field( 'name', $category->name, $category->term_id, 'link_category', 'display' ); 283 $catdesc = sanitize_term_field( 'description', $category->description, $category->term_id, 'link_category', 'display' ); 284 281 285 $default_cat_id = (int) get_option( 'default_link_category' ); 282 $name = ( $name_override ? $name_override : $cat egory->name );286 $name = ( $name_override ? $name_override : $catname ); 283 287 $edit_link = "link-category.php?action=edit&cat_ID=$category->term_id"; 284 288 if ( current_user_can( 'manage_categories' ) ) { 285 $edit = "<a class='row-title' href='$edit_link' title='" . attribute_escape(sprintf(__('Edit "%s"'), $cat egory->name)) . "'>$name</a><br />";289 $edit = "<a class='row-title' href='$edit_link' title='" . attribute_escape(sprintf(__('Edit "%s"'), $catname)) . "'>$name</a><br />"; 286 290 $actions = array(); 287 291 $actions['edit'] = '<a href="' . $edit_link . '">' . __('Edit') . '</a>'; 288 292 $actions['inline hide-if-no-js'] = '<a href="#" class="editinline">' . __('Quick Edit') . '</a>'; … … 334 338 $output .= '<div class="cat_parent">' . $qe_data->parent . '</div></div></td>'; 335 339 break; 336 340 case 'description': 337 $output .= "<td $attributes>$cat egory->description</td>";341 $output .= "<td $attributes>$catdesc</td>"; 338 342 break; 339 343 case 'links': 340 344 $attributes = 'class="links column-links num"' . $style; … … 343 347 } 344 348 $output .= '</tr>'; 345 349 346 return apply_filters( 'link_cat_row', $output );350 return $output; 347 351 } 348 352 349 353 /** … … 665 669 $out .= _tag_row( $tag, ++$count % 2 ? ' class="iedit alternate"' : ' class="iedit"' ); 666 670 667 671 // filter and send to screen 668 $out = apply_filters('tag_rows', $out);669 672 echo $out; 670 673 return $count; 671 674 }