[wp-trac] [WordPress Trac] #47443: REST-API prevents users with edit_published_posts capability updating published posts

WordPress Trac noreply at wordpress.org
Tue Sep 15 13:03:49 UTC 2020


#47443: REST-API prevents users with edit_published_posts capability updating
published posts
--------------------------------------+-----------------------------
 Reporter:  derweili                  |       Owner:  (none)
     Type:  defect (bug)              |      Status:  new
 Priority:  normal                    |   Milestone:  Future Release
Component:  REST API                  |     Version:  5.2.1
 Severity:  normal                    |  Resolution:
 Keywords:  has-patch has-unit-tests  |     Focuses:  rest-api
--------------------------------------+-----------------------------

Comment (by derweili):

 I modified the mentioned `handle_status_param` method to first check if we
 are editing an existing post or a new post.
 Secondly, if we are editing an existing post there is an additional check
 for the current status when the requested status is `future` or `publish`

 So basically the the approach from @peterwilsoncc with another check for
 the current status.

 The unit tests now have no more errors.

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


More information about the wp-trac mailing list