Make WordPress Core

Opened 15 years ago

Closed 15 years ago

Last modified 15 years ago

#18891 closed defect (bug) (fixed)

wp_error does not recognize when a custom post type does not support excerpts

Reported by: ZaneMatthew Owned by:
Priority: normal Milestone: 3.3
Component: General Version: 3.2.1
Severity: normal Keywords: has-patch
Cc: Focuses:

Description

wp_error does not take into consideration if a custom post type does not support excerpts.

Steps to reproduce:

  1. Create a custom post type that does NOT support excerpts.
  2. Use wp_insert_post to insert the post
  3. print_r your error message and you'll see that wp_error is returns:

"Content, title, and excerpt are empty."

It should not mention excerpts being empty as the custom post type does not even support them.

Attachments (1)

18891.patch (1.0 KB ) - added by SergeyBiryukov 15 years ago.

Download all attachments as: .zip

Change History (8)

#1 @solarissmoke
15 years ago

Is this a duplicate of #18713?

#2 @ZaneMatthew
15 years ago

  • Resolutionduplicate
  • Status newclosed

Yes it is, sorry.

#3 @SergeyBiryukov
15 years ago

  • Resolution duplicate
  • Status closedreopened

Related, but doesn't look like an exact duplicate to me.

#18713 is about wp_insert_post() bailing too early, while this ticket is about more correct error message.

Version 0, edited 15 years ago by SergeyBiryukov (next)

#4 @SergeyBiryukov
15 years ago

  • Keywords has-patch added

#5 follow-up: @SergeyBiryukov
15 years ago

  • Milestone Awaiting Review3.3
  • Resolutionfixed
  • Status reopenedclosed

#6 in reply to: ↑ 5 ; follow-up: @johnbillion
15 years ago

Replying to SergeyBiryukov:

[19305]

Doesn't this change mean that whole check now gets skipped if one or more of those fields aren't supported by the post type?

#7 in reply to: ↑ 6 @nacin
15 years ago

Replying to johnbillion:

Replying to SergeyBiryukov:

[19305]

Doesn't this change mean that whole check now gets skipped if one or more of those fields aren't supported by the post type?

Yes. It basically means this check no longer applies to any customized post types.

Note: See TracTickets for help on using tickets.