[wp-trac] [WordPress Trac] #29789: Bulk Actions Selectbox is displayed even when user can't edit or trash anything

WordPress Trac noreply at wordpress.org
Mon Aug 24 21:38:14 UTC 2015


#29789: Bulk Actions Selectbox is displayed even when user can't edit or trash
anything
-----------------------------------+---------------------------------
 Reporter:  psoluch                |       Owner:  wonderboymusic
     Type:  enhancement            |      Status:  reopened
 Priority:  normal                 |   Milestone:  4.4
Component:  Posts, Post Types      |     Version:
 Severity:  normal                 |  Resolution:
 Keywords:  has-patch ux-feedback  |     Focuses:  ui, administration
-----------------------------------+---------------------------------

Comment (by kitchin):

 @DeBAAT : The caps per post are checked for each row and that determines
 whether a checkbox is present on that row. Some sites may have delete/edit
 caps in odd configurations. The bug is to hide or remove the select
 dropdown when it cannot be used on the list displayed.

 In wp-admin/post.php and wp-admin/edit.php you can see 'untrash' is
 checked against `current_user_can( 'delete_post', $post_id)`. Rather than
 guessing with the overall caps 'delete_posts' and 'edit_posts' (note the
 "...s"), it makes more sense to have the <select> UI agree with the
 checkboxes.

 To make it more accurate, we could add data to each checkbox for what
 actions are available on that row, and then reduce the <options> as
 needed. But aside from that, I think using the UI is an accurate solution.

 For testing, start with the Hello World post, and then as a Contributor
 create a new draft. In the posts lists you will have one checkbox and
 <select>. Trash the draft and you will have no checkboxes and no <select>.
 Switch to "Trash" and you will have one checkbox and <select>.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/29789#comment:11>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list