Opened 2 years ago

Closed 2 years ago

#15511 closed defect (bug) (fixed)

Check for WP_Error earlier in edit_post

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

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 2 years ago.

Download all attachments as: .zip

Change History (5)

  • Cc alex@… added
  • Keywords has-patch added
  • Milestone changed from Awaiting Review to 3.1

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

#14334 closed as a duplicate.

  • 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.