WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 5 years ago

#12987 closed defect (bug) (fixed)

Some capability checks need update for custom post types

Reported by: duck_ Owned by:
Milestone: 3.0 Priority: normal
Severity: normal Version: 3.0
Component: Posts, Post Types Keywords: has-patch
Focuses: Cc:

Description

Create new custom post type (e.g. album) with capability_type page. Create new subscriber and add necessary capabilities to interact with the new post type (most importantly edit_others_pages, publish_pages and edit_published_pages). If you login as the new user and try to publish a new album post it will only create a album post with status pending. Also if you try to edit an album post created by a different user when you click update WordPress dies with the error 'You are not allowed to edit posts as this user.'

Cause of both of these problems is in _wp_translate_postdata.

Attachments (1)

post.php.diff (2.0 KB) - added by duck_ 5 years ago.

Download all attachments as: .zip

Change History (2)

@duck_5 years ago

comment:1 @dd325 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [14130]) Update _wp_translate_postdata() capability checks to use Post Type API capability fields. Props duck_. Fixes #12987

Note: See TracTickets for help on using tickets.