WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 4 years ago

#15511 closed defect (bug) (fixed)

Check for WP_Error earlier in edit_post

Reported by: alexdunae Owned by:
Milestone: 3.1 Priority: normal
Severity: normal Version:
Component: General Keywords: has-patch
Focuses: Cc:

Description

When working with custom post types where I hadn't assign the edit_others capabilities, _wp_translate_postdata was returning WP_Error.

edit_post checks for WP_Error, but not before assuming that the return value is actually array and triggering an ugly error.

Attachments (1)

post.diff (657 bytes) - added by alexdunae 4 years ago.

Download all attachments as: .zip

Change History (5)

@alexdunae4 years ago

comment:1 @alexdunae4 years ago

  • Cc alex@… added
  • Keywords has-patch added

comment:2 @nacin4 years ago

  • Milestone changed from Awaiting Review to 3.1

Sure, looks good. Will want to blame the surrounding code to see why that got inserted.

comment:3 @nacin4 years ago

#14334 closed as a duplicate.

comment:4 @nacin4 years ago

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

(In [16761]) Move [14551] to after the is_wp_error check. see #13133, fixes #15511, props alexdunae.

Note: See TracTickets for help on using tickets.