Show Empty Trash button only when the user has cap. props mrmist, see #4529

git-svn-id: https://develop.svn.wordpress.org/trunk@11778 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Ozz 2009-08-05 23:50:29 +00:00
parent 7bc6b530f2
commit 9376d20e68
2 changed files with 6 additions and 4 deletions

View File

@ -305,7 +305,7 @@ if ( ( 'spam' == $comment_status || 'trash' == $comment_status) && current_user_
wp_nonce_field('bulk-destroy', '_destroy_nonce');
if ( 'spam' == $comment_status ) { ?>
<input type="submit" name="delete_all" id="delete_all" value="<?php esc_attr_e('Empty Spam'); ?>" class="button-secondary apply" />
<?php } elseif ( 'trash' == $comment_status ) { ?>
<?php } elseif ( 'trash' == $comment_status && current_user_can('moderate_comments') ) { ?>
<input type="submit" name="delete_all" id="delete_all" value="<?php esc_attr_e('Empty Trash'); ?>" class="button-secondary apply" />
<?php }
} ?>
@ -377,7 +377,7 @@ if ( $page_links )
<?php if ( 'spam' == $comment_status ) { ?>
<input type="submit" name="delete_all2" id="delete_all2" value="<?php esc_attr_e('Empty Spam'); ?>" class="button-secondary apply" />
<?php } elseif ( 'trash' == $comment_status ) { ?>
<?php } elseif ( 'trash' == $comment_status && current_user_can('moderate_comments') ) { ?>
<input type="submit" name="delete_all2" id="delete_all2" value="<?php esc_attr_e('Empty Trash'); ?>" class="button-secondary apply" />
<?php } ?>
<?php do_action('manage_comments_nav', $comment_status); ?>

View File

@ -287,7 +287,9 @@ wp_dropdown_categories($dropdown_options);
do_action('restrict_manage_posts');
?>
<input type="submit" id="post-query-submit" value="<?php esc_attr_e('Filter'); ?>" class="button-secondary" />
<?php } if ( $_GET['post_status'] == 'trash' ) { ?>
<?php }
if ( $_GET['post_status'] == 'trash' && current_user_can('edit_others_posts') ) { ?>
<input type="submit" name="delete_all" id="delete_all" value="<?php esc_attr_e('Empty Trash'); ?>" class="button-secondary apply" />
<?php } ?>
</div>
@ -332,7 +334,7 @@ if ( $page_links )
<?php } ?>
</select>
<input type="submit" value="<?php esc_attr_e('Apply'); ?>" name="doaction2" id="doaction2" class="button-secondary action" />
<?php if ( $_GET['post_status'] == 'trash' ) { ?>
<?php if ( $_GET['post_status'] == 'trash' && current_user_can('edit_others_posts') ) { ?>
<input type="submit" name="delete_all2" id="delete_all2" value="<?php esc_attr_e('Empty Trash'); ?>" class="button-secondary apply" />
<?php } ?>
<br class="clear" />