Make WordPress Core


Ignore:
Timestamp:
11/12/2010 04:35:28 PM (14 years ago)
Author:
ryan
Message:

Check delete_site and delete_sites caps. Check for delete_user is more places.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/class-wp-ms-sites-list-table.php

    r16289 r16329  
    116116    function get_bulk_actions() {
    117117        $actions = array();
    118         $actions['delete'] = __( 'Delete' );
     118        if ( current_user_can( 'delete_sites' ) )
     119            $actions['delete'] = __( 'Delete' );
    119120        $actions['spam'] = _x( 'Mark as Spam', 'site' );
    120121        $actions['notspam'] = _x( 'Not Spam', 'site' );
     
    248249                                    $actions['spam']    = '<span class="spam"><a href="' . esc_url( network_admin_url( 'edit.php?action=confirm&amp;action2=spamblog&amp;id=' . $blog['blog_id'] . '&amp;msg=' . urlencode( sprintf( __( 'You are about to mark the site %s as spam.' ), $blogname ) ) ) ) . '">' . _x( 'Spam', 'site' ) . '</a></span>';
    249250
    250                                 $actions['delete']  = '<span class="delete"><a href="' . esc_url( network_admin_url( 'edit.php?action=confirm&amp;action2=deleteblog&amp;id=' . $blog['blog_id'] . '&amp;msg=' . urlencode( sprintf( __( 'You are about to delete the site %s.' ), $blogname ) ) ) ) . '">' . __( 'Delete' ) . '</a></span>';
     251                                if ( current_user_can( 'delete_site', $blog['blog_id'] ) )
     252                                    $actions['delete']  = '<span class="delete"><a href="' . esc_url( network_admin_url( 'edit.php?action=confirm&amp;action2=deleteblog&amp;id=' . $blog['blog_id'] . '&amp;msg=' . urlencode( sprintf( __( 'You are about to delete the site %s.' ), $blogname ) ) ) ) . '">' . __( 'Delete' ) . '</a></span>';
    251253                            }
    252254
Note: See TracChangeset for help on using the changeset viewer.