WordPress.org

Make WordPress Core

Changeset 15336


Ignore:
Timestamp:
06/27/10 01:05:53 (4 years ago)
Author:
nacin
Message:

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.

Location:
trunk/wp-admin
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/admin-ajax.php

    r15313 r15336  
    553553case 'add-tag' : // From Manage->Tags 
    554554    check_ajax_referer( 'add-tag' ); 
    555  
     555    $post_type = !empty($_POST['post_type']) ? $_POST['post_type'] : 'post'; 
    556556    $taxonomy = !empty($_POST['taxonomy']) ? $_POST['taxonomy'] : 'post_tag'; 
    557557    $tax = get_taxonomy($taxonomy); 
  • trunk/wp-admin/edit-tags.php

    r15263 r15336  
    383383<input type="hidden" name="screen" value="<?php echo esc_attr($current_screen->id); ?>" /> 
    384384<input type="hidden" name="taxonomy" value="<?php echo esc_attr($taxonomy); ?>" /> 
     385<input type="hidden" name="post_type" value="<?php echo esc_attr($post_type); ?>" /> 
    385386<?php wp_nonce_field('add-tag'); ?> 
    386387 
  • trunk/wp-admin/includes/template.php

    r15315 r15336  
    13901390                $out = array(); 
    13911391                foreach ( $categories as $c ) 
    1392                     $out[] = "<a href='edit.php?category_name=$c->slug'> " . esc_html(sanitize_term_field('name', $c->name, $c->term_id, 'category', 'display')) . '</a>'; 
     1392                    $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>'; 
    13931393                    echo join( ', ', $out ); 
    13941394            } else { 
     
    14061406                $out = array(); 
    14071407                foreach ( $tags as $c ) 
    1408                     $out[] = "<a href='edit.php?tag=$c->slug'> " . esc_html(sanitize_term_field('name', $c->name, $c->term_id, 'post_tag', 'display')) . '</a>'; 
     1408                    $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>'; 
    14091409                echo join( ', ', $out ); 
    14101410            } else { 
Note: See TracChangeset for help on using the changeset viewer.