Check for the import cap before showing links to the tag/cat converter. props kpdesign, fixes #13834.

git-svn-id: http://svn.automattic.com/wordpress/trunk@15205 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
nacin 2010-06-11 00:00:47 +00:00
parent e85cb9a279
commit 6f289a7be8
2 changed files with 5 additions and 2 deletions

View File

@ -337,9 +337,11 @@ if ( $page_links )
<?php if ( 'category' == $taxonomy ) : ?>
<div class="form-wrap">
<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>
<?php if ( current_user_can( 'import' ) ) : ?>
<p><?php printf(__('Categories can be selectively converted to tags using the <a href="%s">category to tag converter</a>.'), 'import.php') ?></p>
<?php endif; ?>
</div>
<?php elseif ( 'post_tag' == $taxonomy ) : ?>
<?php elseif ( 'post_tag' == $taxonomy && current_user_can( 'import' ) ) : ?>
<div class="form-wrap">
<p><?php printf(__('Tags can be selectively converted to categories using the <a href="%s">tag to category converter</a>'), 'import.php') ;?>.</p>
</div>

View File

@ -38,9 +38,9 @@ require_once('./admin-header.php');
<?php
endif;
if ( current_user_can( 'import' ) ) :
$cats = get_taxonomy('category');
$tags = get_taxonomy('post_tag');
if ( current_user_can($cats->cap->manage_terms) || current_user_can($tags->cap->manage_terms) ) : ?>
<div class="tool-box">
<h3 class="title"><?php _e( 'Categories and Tags Converter' ) ?></h3>
@ -48,6 +48,7 @@ if ( current_user_can($cats->cap->manage_terms) || current_user_can($tags->cap->
</div>
<?php
endif;
endif;
do_action( 'tool_box' );
?>