From 73b2b7c16409cd87a0358ffe585dfadbe7db966b Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Sun, 27 Jun 2010 01:05:53 +0000 Subject: [PATCH] Make Categories/Tags columns on edit.php properly aware of post types. Also ensure AJAX add-tag on edit-tags.php is given the post type. fixes #14061 for trunk. git-svn-id: https://develop.svn.wordpress.org/trunk@15336 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/admin-ajax.php | 2 +- wp-admin/edit-tags.php | 1 + wp-admin/includes/template.php | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/wp-admin/admin-ajax.php b/wp-admin/admin-ajax.php index 0997c76268..142f9d80c6 100644 --- a/wp-admin/admin-ajax.php +++ b/wp-admin/admin-ajax.php @@ -552,7 +552,7 @@ case 'add-link-cat' : // From Blogroll -> Categories break; case 'add-tag' : // From Manage->Tags check_ajax_referer( 'add-tag' ); - + $post_type = !empty($_POST['post_type']) ? $_POST['post_type'] : 'post'; $taxonomy = !empty($_POST['taxonomy']) ? $_POST['taxonomy'] : 'post_tag'; $tax = get_taxonomy($taxonomy); diff --git a/wp-admin/edit-tags.php b/wp-admin/edit-tags.php index 1991270540..5fc181569c 100644 --- a/wp-admin/edit-tags.php +++ b/wp-admin/edit-tags.php @@ -382,6 +382,7 @@ if ( current_user_can($tax->cap->edit_terms) ) { +
diff --git a/wp-admin/includes/template.php b/wp-admin/includes/template.php index 2286450407..759d818785 100644 --- a/wp-admin/includes/template.php +++ b/wp-admin/includes/template.php @@ -1389,7 +1389,7 @@ function _post_row($a_post, $pending_comments, $mode) { if ( !empty( $categories ) ) { $out = array(); foreach ( $categories as $c ) - $out[] = " " . esc_html(sanitize_term_field('name', $c->name, $c->term_id, 'category', 'display')) . ''; + $out[] = " " . esc_html(sanitize_term_field('name', $c->name, $c->term_id, 'category', 'display')) . ''; echo join( ', ', $out ); } else { _e('Uncategorized'); @@ -1405,7 +1405,7 @@ function _post_row($a_post, $pending_comments, $mode) { if ( !empty( $tags ) ) { $out = array(); foreach ( $tags as $c ) - $out[] = " " . esc_html(sanitize_term_field('name', $c->name, $c->term_id, 'post_tag', 'display')) . ''; + $out[] = " " . esc_html(sanitize_term_field('name', $c->name, $c->term_id, 'post_tag', 'display')) . ''; echo join( ', ', $out ); } else { _e('No Tags');