Opened 16 months ago

Last modified 7 months ago

#19954 new defect (bug)

wp_insert_post should look if default category is nessesary

Reported by: markoheijnen Owned by:
Priority: normal Milestone: Future Release
Component: Post Types Version:
Severity: normal Keywords: has-patch
Cc: markoheijnen, t.herzog@…

Description

When creating an post object with get_default_post_to_edit(), wp_insert_post() will ignored the set category.
It doesn't look if the post has already a good category.

Attachments (1)

19954.patch (1.0 KB) - added by markoheijnen 16 months ago.
Does fix the issue. Maybe need better formating

Download all attachments as: .zip

Change History (8)

Does fix the issue. Maybe need better formating

  • Milestone changed from Awaiting Review to 3.4
  • Cc t.herzog@… added

Why should this be? WordPress sets category to the default one if there hasn't been setted one.

  • Keywords has-patch added

Could we have some example code that triggers this?

Is this an issue to fix/benefit XML-RPC changes in 3.4 at this point?

I don't believe it is xml-rpc related. What I did was adding the category with the metod wp_set_object_terms() on the post ID what you get from get_default_post_to_edit(). I know thisis a rare condition.

  • Milestone changed from 3.4 to Future Release

#22220 was marked as a duplicate.

Note: See TracTickets for help on using tickets.