#31917 closed defect (bug) (invalid)
Cannot edit custom post even if capabilities are assigned to user role
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | Posts, Post Types | Keywords: | has-patch |
Focuses: | Cc: |
Description
It seems that users with proper capabilities can't edit custom post types due to two issues:
- There is no edit link on posts list
- There is incorrect check in post.php
Example of problem:
File post.php
if ( ! current_user_can( 'edit_post', $post_id ) )
wp_die( __( 'You are not allowed to edit this item.' ) );
could be
if ( ! current_user_can( $post_type_object->cap->edit_posts, $post_id ) )
wp_die( __( 'You are not allowed to edit this item.' ) );
Attachments (2)
Change History (6)
#1
follow-up:
↓ 3
@
10 years ago
- Keywords reporter-feedback added
Hi @lpawlik,
Is this issue new to trunk or has this been around in 4.1.1 or before?
#3
in reply to:
↑ 1
@
10 years ago
- Resolution set to invalid
- Status changed from new to closed
Replying to DrewAPicture:
Hi @lpawlik,
Is this issue new to trunk or has this been around in 4.1.1 or before?
Hi,
I've checked the history and it seems that my patch is reverting changes made in https://github.com/WordPress/WordPress/commit/c2db94d10cb01fbb5babcd717896c89fa82f90e0.
Now I think it's not a bug - I should add edit_published_posts
capability.
Note: See
TracTickets for help on using
tickets.
Proposed patch.