WordPress.org

Making WordPress.org


Ignore:
Timestamp:
05/17/2016 05:34:49 PM (4 years ago)
Author:
obenland
Message:

Plugin Directory: Add a way to bulk reject plugins.

Probably most useful in draft or pending views.

See #1570.

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

    r3093 r3157  
    6262            'per_page' => $per_page
    6363        ) );
     64    }
     65
     66    /**
     67     *
     68     * @return array
     69     */
     70    protected function get_bulk_actions() {
     71        $actions = array();
     72        $post_type_obj = get_post_type_object( $this->screen->post_type );
     73
     74        if ( current_user_can( $post_type_obj->cap->edit_posts ) ) {
     75            if ( $this->is_trash ) {
     76                $actions['untrash'] = __( 'Restore' );
     77            } else {
     78                $actions['edit'] = __( 'Edit' );
     79            }
     80        }
     81
     82        if ( current_user_can( 'plugin_reject' ) && ( empty( $_REQUEST['post_status'] ) || in_array( $_REQUEST['post_status'], array( 'draft', 'pending' ) ) ) ) {
     83            $actions['plugin_reject'] = __( 'Reject', 'wporg-plugins' );
     84        }
     85
     86        if ( current_user_can( $post_type_obj->cap->delete_posts ) ) {
     87            if ( $this->is_trash || ! EMPTY_TRASH_DAYS ) {
     88                $actions['delete'] = __( 'Delete Permanently' );
     89            } else {
     90                $actions['trash'] = __( 'Move to Trash' );
     91            }
     92        }
     93
     94        return $actions;
    6495    }
    6596
Note: See TracChangeset for help on using the changeset viewer.