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: http://svn.automattic.com/wordpress/trunk@15336 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
nacin 2010-06-27 01:05:53 +00:00
parent 2ff7c13096
commit 57bc2fd164
3 changed files with 4 additions and 3 deletions

View File

@ -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);

View File

@ -382,6 +382,7 @@ if ( current_user_can($tax->cap->edit_terms) ) {
<input type="hidden" name="action" value="add-tag" />
<input type="hidden" name="screen" value="<?php echo esc_attr($current_screen->id); ?>" />
<input type="hidden" name="taxonomy" value="<?php echo esc_attr($taxonomy); ?>" />
<input type="hidden" name="post_type" value="<?php echo esc_attr($post_type); ?>" />
<?php wp_nonce_field('add-tag'); ?>
<div class="form-field form-required">

View File

@ -1389,7 +1389,7 @@ function _post_row($a_post, $pending_comments, $mode) {
if ( !empty( $categories ) ) {
$out = array();
foreach ( $categories as $c )
$out[] = "<a href='edit.php?category_name=$c->slug'> " . esc_html(sanitize_term_field('name', $c->name, $c->term_id, 'category', 'display')) . '</a>';
$out[] = "<a href='edit.php?post_type={$post->post_type}&amp;category_name={$c->slug}'> " . esc_html(sanitize_term_field('name', $c->name, $c->term_id, 'category', 'display')) . '</a>';
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[] = "<a href='edit.php?tag=$c->slug'> " . esc_html(sanitize_term_field('name', $c->name, $c->term_id, 'post_tag', 'display')) . '</a>';
$out[] = "<a href='edit.php?post_type={$post->post_type}&amp;tag={$c->slug}'> " . esc_html(sanitize_term_field('name', $c->name, $c->term_id, 'post_tag', 'display')) . '</a>';
echo join( ', ', $out );
} else {
_e('No Tags');