From 38b36389950e3965a44ece19b3cacb7671c5e1b0 Mon Sep 17 00:00:00 2001 From: Andrew Ozz Date: Tue, 18 Nov 2008 07:15:32 +0000 Subject: [PATCH] Fix QE data filtering for tags and categories, props jhodgdon fixes #8146 git-svn-id: https://develop.svn.wordpress.org/trunk@9751 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/edit-link-categories.php | 1 - wp-admin/includes/template.php | 52 +++++++++++++++++-------------- wp-admin/wp-admin.css | 9 +++--- 3 files changed, 33 insertions(+), 29 deletions(-) diff --git a/wp-admin/edit-link-categories.php b/wp-admin/edit-link-categories.php index 5c981f347d..2b2427ecd4 100644 --- a/wp-admin/edit-link-categories.php +++ b/wp-admin/edit-link-categories.php @@ -141,7 +141,6 @@ $categories = get_terms( 'link_category', $args ); if ( $categories ) { $output = ''; foreach ( $categories as $category ) { - $category = sanitize_term($category, 'link_category', 'display'); $output .= link_cat_row($category); } $output = apply_filters('cat_rows', $output); diff --git a/wp-admin/includes/template.php b/wp-admin/includes/template.php index e958cb54f9..ae95d9f46d 100644 --- a/wp-admin/includes/template.php +++ b/wp-admin/includes/template.php @@ -114,13 +114,16 @@ function _cat_row( $category, $level, $name_override = false ) { static $row_class; $category = get_category( $category ); + $catname = sanitize_term_field( 'name', $category->name, $category->term_id, 'category', 'display' ); + $catdesc = sanitize_term_field( 'description', $category->description, $category->term_id, 'category', 'display' ); + $qe_name = sanitize_term_field( 'name', $category->name, $category->term_id, 'category', 'edit' ); $default_cat_id = (int) get_option( 'default_category' ); $pad = str_repeat( '— ', $level ); - $name = ( $name_override ? $name_override : $pad . ' ' . $category->name ); + $name = ( $name_override ? $name_override : $pad . ' ' . $catname ); $edit_link = "categories.php?action=edit&cat_ID=$category->term_id"; if ( current_user_can( 'manage_categories' ) ) { - $edit = "name)) . "'>" . attribute_escape( $name ) . '
'; + $edit = "" . attribute_escape( $name ) . '
'; $actions = array(); $actions['edit'] = '' . __('Edit') . ''; $actions['inline hide-if-no-js'] = '' . __('Quick Edit') . ''; @@ -138,8 +141,6 @@ function _cat_row( $category, $level, $name_override = false ) { } $row_class = 'alternate' == $row_class ? '' : 'alternate'; - $qe_data = get_category_to_edit($category->term_id); - $category->count = number_format_i18n( $category->count ); $posts_count = ( $category->count > 0 ) ? "$category->count" : $category->count; $output = ""; @@ -167,13 +168,13 @@ function _cat_row( $category, $level, $name_override = false ) { break; case 'name': $output .= "$edit"; - $output .= ''; + $output .= ''; break; case 'description': - $output .= "$category->description"; + $output .= "$catdesc"; break; case 'slug': $output .= "$category->slug"; @@ -278,11 +279,15 @@ function link_cat_row( $category, $name_override = false ) { if ( is_wp_error( $category ) ) return $category; + $catname = sanitize_term_field( 'name', $category->name, $category->term_id, 'category', 'display' ); + $catdesc = sanitize_term_field( 'description', $category->description, $category->term_id, 'category', 'display' ); + $qe_name = sanitize_term_field( 'name', $category->name, $category->term_id, 'category', 'edit' ); + $default_cat_id = (int) get_option( 'default_link_category' ); - $name = ( $name_override ? $name_override : $category->name ); + $name = ( $name_override ? $name_override : $catname ); $edit_link = "link-category.php?action=edit&cat_ID=$category->term_id"; if ( current_user_can( 'manage_categories' ) ) { - $edit = "name)) . "'>$name
"; + $edit = "$name
"; $actions = array(); $actions['edit'] = '' . __('Edit') . ''; $actions['inline hide-if-no-js'] = '' . __('Quick Edit') . ''; @@ -300,8 +305,6 @@ function link_cat_row( $category, $name_override = false ) { } $class = 'alternate' == $class ? '' : 'alternate'; - $qe_data = get_term_to_edit($category->term_id, 'link_category'); - $category->count = number_format_i18n( $category->count ); $count = ( $category->count > 0 ) ? "$category->count" : $category->count; $output = ""; @@ -328,13 +331,13 @@ function link_cat_row( $category, $name_override = false ) { break; case 'name': $output .= "$edit"; - $output .= ''; + $output .= ''; break; case 'description': - $output .= "$category->description"; + $output .= "$catdesc"; break; case 'links': $attributes = 'class="links column-links num"' . $style; @@ -576,11 +579,12 @@ function wp_link_category_checklist( $link_id = 0 ) { * @return unknown */ function _tag_row( $tag, $class = '' ) { + $count = number_format_i18n( $tag->count ); $count = ( $count > 0 ) ? "$count" : $count; + $tagname = sanitize_term_field( 'name', $tag->name, $tag->term_id, 'tag', 'display' ); + $qe_name = sanitize_term_field( 'name', $tag->name, $tag->term_id, 'tag', 'edit' ); - $name = apply_filters( 'term_name', $tag->name ); - $qe_data = get_term($tag->term_id, 'post_tag', object, 'edit'); $edit_link = "edit-tags.php?action=edit&tag_ID=$tag->term_id"; $out = ''; $out .= ''; @@ -600,7 +604,7 @@ function _tag_row( $tag, $class = '' ) { $out .= ' '; break; case 'name': - $out .= '' . $name . '
'; + $out .= '' . $tagname . '
'; $actions = array(); $actions['edit'] = '' . __('Edit') . ''; $actions['inline hide-if-no-js'] = '' . __('Quick Edit') . ''; @@ -612,9 +616,9 @@ function _tag_row( $tag, $class = '' ) { ( $i == $action_count ) ? $sep = '' : $sep = ' | '; $out .= "$link$sep"; } - $out .= ''; + $out .= ''; break; case 'slug': $out .= "$tag->slug"; diff --git a/wp-admin/wp-admin.css b/wp-admin/wp-admin.css index dec30032e6..514733b1b5 100644 --- a/wp-admin/wp-admin.css +++ b/wp-admin/wp-admin.css @@ -1328,14 +1328,15 @@ html, body { .form-table table.color-palette { vertical-align: bottom; float: left; - margin: -3px 3px 8px; + margin: -8px 3px 12px; } .form-table .color-palette td { border-bottom: none; border: 1px solid #fff; - font-size: 1px; - line-height: 1px; + height: 10px; + line-height: 20px; + width: 10px; } textarea.large-text { @@ -1657,7 +1658,7 @@ table.form-table td .updated { .meta-box-sortables .postbox .handlediv { float: right; width: 23px; - height: 27px; + height: 26px; } .sortable-placeholder {