[wp-trac] [WordPress Trac] #31917: Cannot edit custom post even if capabilities are assigned to user role

WordPress Trac noreply at wordpress.org
Tue Apr 7 11:08:56 UTC 2015


#31917: Cannot edit custom post even if capabilities are assigned to user role
-------------------------------+-----------------------------
 Reporter:  lpawlik            |      Owner:
     Type:  defect (bug)       |     Status:  new
 Priority:  normal             |  Milestone:  Awaiting Review
Component:  Posts, Post Types  |    Version:  trunk
 Severity:  normal             |   Keywords:
  Focuses:                     |
-------------------------------+-----------------------------
 It seems that users with proper capabilities can't edit custom post types
 due to two issues:

 1. There is no '''edit''' link on posts list
 2. There is incorrect check in post.php

 Example of problem:
 File post.php

 {{{#!php
 if ( ! current_user_can( 'edit_post', $post_id ) )
     wp_die( __( 'You are not allowed to edit this item.' ) );
 }}}
 could be
 {{{#!php
 if ( ! current_user_can( $post_type_object->cap->edit_posts, $post_id ) )
     wp_die( __( 'You are not allowed to edit this item.' ) );
 }}}

--
Ticket URL: <https://core.trac.wordpress.org/ticket/31917>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list