Make WordPress Core

Changeset 11778


Ignore:
Timestamp:
08/05/2009 11:50:29 PM (14 years ago)
Author:
azaozz
Message:

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

Location:
trunk/wp-admin
Files:
2 edited

Legend:

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

    r11763 r11778  
    306306    if ( 'spam' == $comment_status ) { ?>
    307307        <input type="submit" name="delete_all" id="delete_all" value="<?php esc_attr_e('Empty Spam'); ?>" class="button-secondary apply" />
    308 <?php } elseif ( 'trash' == $comment_status ) { ?>
     308<?php } elseif ( 'trash' == $comment_status && current_user_can('moderate_comments') ) { ?>
    309309        <input type="submit" name="delete_all" id="delete_all" value="<?php esc_attr_e('Empty Trash'); ?>" class="button-secondary apply" />
    310310<?php }
     
    378378<?php if ( 'spam' == $comment_status ) { ?>
    379379<input type="submit" name="delete_all2" id="delete_all2" value="<?php esc_attr_e('Empty Spam'); ?>" class="button-secondary apply" />
    380 <?php } elseif ( 'trash' == $comment_status ) { ?>
     380<?php } elseif ( 'trash' == $comment_status && current_user_can('moderate_comments') ) { ?>
    381381<input type="submit" name="delete_all2" id="delete_all2" value="<?php esc_attr_e('Empty Trash'); ?>" class="button-secondary apply" />
    382382<?php } ?>
  • trunk/wp-admin/edit.php

    r11763 r11778  
    288288?>
    289289<input type="submit" id="post-query-submit" value="<?php esc_attr_e('Filter'); ?>" class="button-secondary" />
    290 <?php } if ( $_GET['post_status'] == 'trash' ) { ?>
     290<?php }
     291
     292if ( $_GET['post_status'] == 'trash' && current_user_can('edit_others_posts') ) { ?>
    291293<input type="submit" name="delete_all" id="delete_all" value="<?php esc_attr_e('Empty Trash'); ?>" class="button-secondary apply" />
    292294<?php } ?>
     
    333335</select>
    334336<input type="submit" value="<?php esc_attr_e('Apply'); ?>" name="doaction2" id="doaction2" class="button-secondary action" />
    335 <?php if ( $_GET['post_status'] == 'trash' ) { ?>
     337<?php if ( $_GET['post_status'] == 'trash' && current_user_can('edit_others_posts') ) { ?>
    336338<input type="submit" name="delete_all2" id="delete_all2" value="<?php esc_attr_e('Empty Trash'); ?>" class="button-secondary apply" />
    337339<?php } ?>
Note: See TracChangeset for help on using the changeset viewer.