Make WordPress Core


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/edit-tags.php

    r14989 r15220  
    1515    $taxonomy = 'post_tag';
    1616
    17 if ( !is_taxonomy($taxonomy) )
     17if ( !taxonomy_exists($taxonomy) )
    1818    wp_die(__('Invalid taxonomy'));
    1919
     
    181181        '<li>' . __('<strong>Name</strong> - The name is how it appears on your site.') . '</li>';
    182182    if ( ! global_terms_enabled() )
    183         $help .= '<li>' . __('<strong>Slug</strong> - The  &#8220;slug&#8221; is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens.') . '</li>';
     183        $help .= '<li>' . __('<strong>Slug</strong> - The &#8220;slug&#8221; is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens.') . '</li>';
    184184
    185185    if ( 'category' == $taxonomy )
     
    192192
    193193    if ( 'category' == $taxonomy )
    194         $help .= '<p>' . __('<a href="http://codex.wordpress.org/Manage_Categories_SubPanel">Categories Documentation</a>') . '</p>';
    195     else
    196         $help .= '<p>' . __('<a href="http://codex.wordpress.org/Post_Tags_SubPanel">Tags Documentation</a>') . '</p>';
    197 
    198     $help .= '<p>' . __('<a href="http://wordpress.org/support/">Support Forums</a>') . '</p>';
     194        $help .= '<p>' . __('<a href="http://codex.wordpress.org/Manage_Categories_SubPanel" target="_blank">Categories Documentation</a>') . '</p>';
     195    else
     196        $help .= '<p>' . __('<a href="http://codex.wordpress.org/Post_Tags_SubPanel" target="_blank">Tags Documentation</a>') . '</p>';
     197
     198    $help .= '<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>';
    199199
    200200    add_contextual_help($current_screen, $help);
     
    297297
    298298<div class="clear"></div>
    299 <?php $table_type = ('category' == $taxonomy ? 'categories' : 'edit-tags'); ?>
    300299<table class="widefat tag fixed" cellspacing="0">
    301300    <thead>
    302301    <tr>
    303 <?php print_column_headers($table_type); ?>
     302<?php print_column_headers($current_screen); ?>
    304303    </tr>
    305304    </thead>
     
    307306    <tfoot>
    308307    <tr>
    309 <?php print_column_headers($table_type, false); ?>
     308<?php print_column_headers($current_screen, false); ?>
    310309    </tr>
    311310    </tfoot>
     
    339338<div class="form-wrap">
    340339<p><?php printf(__('<strong>Note:</strong><br />Deleting a category does not delete the posts in that category. Instead, posts that were only assigned to the deleted category are set to the category <strong>%s</strong>.'), apply_filters('the_category', get_cat_name(get_option('default_category')))) ?></p>
     340<?php if ( current_user_can( 'import' ) ) : ?>
    341341<p><?php printf(__('Categories can be selectively converted to tags using the <a href="%s">category to tag converter</a>.'), 'import.php') ?></p>
    342 </div>
    343 <?php elseif ( 'post_tag' == $taxonomy ) : ?>
     342<?php endif; ?>
     343</div>
     344<?php elseif ( 'post_tag' == $taxonomy && current_user_can( 'import' ) ) : ?>
    344345<div class="form-wrap">
    345346<p><?php printf(__('Tags can be selectively converted to categories using the <a href="%s">tag to category converter</a>'), 'import.php') ;?>.</p>
     
    356357
    357358<?php
    358 if ( current_user_can( $tax->cap->edit_terms ) )
    359     $tag_cloud = wp_tag_cloud( array( 'taxonomy' => $taxonomy, 'echo' => false, 'link' => 'edit' ) );
    360 else
    361     $tag_cloud = wp_tag_cloud( array( 'taxonomy' => $taxonomy, 'echo' => false ) );
    362 
    363 if ( $tag_cloud ) :
    364 ?>
     359
     360if ( !is_taxonomy_hierarchical($taxonomy) ) {
     361    if ( current_user_can( $tax->cap->edit_terms ) )
     362        $tag_cloud = wp_tag_cloud( array( 'taxonomy' => $taxonomy, 'echo' => false, 'link' => 'edit' ) );
     363    else
     364        $tag_cloud = wp_tag_cloud( array( 'taxonomy' => $taxonomy, 'echo' => false ) );
     365
     366    if ( $tag_cloud ) :
     367    ?>
    365368<div class="tagcloud">
    366369<h3><?php echo $tax->labels->popular_items; ?></h3>
     
    369372<?php
    370373endif;
     374}
    371375
    372376if ( current_user_can($tax->cap->edit_terms) ) {
     
    382386<form id="addtag" method="post" action="edit-tags.php" class="validate">
    383387<input type="hidden" name="action" value="add-tag" />
     388<input type="hidden" name="screen" value="<?php echo esc_attr($current_screen->id); ?>" />
    384389<input type="hidden" name="taxonomy" value="<?php echo esc_attr($taxonomy); ?>" />
    385390<?php wp_nonce_field('add-tag'); ?>
Note: See TracChangeset for help on using the changeset viewer.