WordPress.org

Making WordPress.org

Changeset 5709


Ignore:
Timestamp:
07/20/17 20:04:54 (5 months ago)
Author:
coffee2code
Message:

Plugin Directory: Remove 'Trash' action.

Permissions already prevent plugins from being trashed.

Props SergeyBiryukov.
See #2796.
Fixes #2983.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/list-table/class-plugin-posts.php

    r5573 r5709  
    8080        if ( current_user_can( 'plugin_reject' ) && ( empty( $_REQUEST['post_status'] ) || in_array( $_REQUEST['post_status'], array( 'new', 'pending' ) ) ) ) { 
    8181            $actions['plugin_reject'] = __( 'Reject', 'wporg-plugins' ); 
    82         } 
    83  
    84         if ( current_user_can( $post_type_obj->cap->delete_posts ) ) { 
    85             if ( $this->is_trash || ! EMPTY_TRASH_DAYS ) { 
    86                 $actions['delete'] = __( 'Delete Permanently', 'wporg-plugins' ); 
    87             } else { 
    88                 $actions['trash'] = __( 'Move to Trash', 'wporg-plugins' ); 
    89             } 
    9082        } 
    9183 
     
    214206            } else { 
    215207                wp_dequeue_script( 'inline-edit-post' ); 
    216             } 
    217         } 
    218  
    219         if ( current_user_can( 'delete_post', $post->ID ) ) { 
    220             if ( 'trash' === $post->post_status ) { 
    221                 $actions['untrash'] = sprintf( 
    222                     '<a href="%s" aria-label="%s">%s</a>', 
    223                     wp_nonce_url( admin_url( sprintf( $post_type_object->_edit_link . '&amp;action=untrash', $post->ID ) ), 'untrash-post_' . $post->ID ), 
    224                     /* translators: %s: post title */ 
    225                     esc_attr( sprintf( __( 'Restore &#8220;%s&#8221; from the Trash', 'wporg-plugins' ), $title ) ), 
    226                     __( 'Restore', 'wporg-plugins' ) 
    227                 ); 
    228             } elseif ( EMPTY_TRASH_DAYS ) { 
    229                 $actions['trash'] = sprintf( 
    230                     '<a href="%s" class="submitdelete" aria-label="%s">%s</a>', 
    231                     get_delete_post_link( $post->ID ), 
    232                     /* translators: %s: post title */ 
    233                     esc_attr( sprintf( __( 'Move &#8220;%s&#8221; to the Trash', 'wporg-plugins' ), $title ) ), 
    234                     _x( 'Trash', 'verb', 'wporg-plugins' ) 
    235                 ); 
    236             } 
    237             if ( 'trash' === $post->post_status || ! EMPTY_TRASH_DAYS ) { 
    238                 $actions['delete'] = sprintf( 
    239                     '<a href="%s" class="submitdelete" aria-label="%s">%s</a>', 
    240                     get_delete_post_link( $post->ID, '', true ), 
    241                     /* translators: %s: post title */ 
    242                     esc_attr( sprintf( __( 'Delete &#8220;%s&#8221; permanently', 'wporg-plugins' ), $title ) ), 
    243                     __( 'Delete Permanently', 'wporg-plugins' ) 
    244                 ); 
    245208            } 
    246209        } 
Note: See TracChangeset for help on using the changeset viewer.