[wp-trac] [WordPress Trac] #23474: wp_update_post returns incorrect WP_Error on invalid ID (if $wp_error is set)

WordPress Trac noreply at wordpress.org
Fri Mar 1 10:48:13 UTC 2013


#23474: wp_update_post returns incorrect WP_Error on invalid ID (if $wp_error is
set)
------------------------------+------------------
 Reporter:  simonwheatley     |       Owner:
     Type:  defect (bug)      |      Status:  new
 Priority:  normal            |   Milestone:  3.6
Component:  Warnings/Notices  |     Version:  3.5
 Severity:  normal            |  Resolution:
 Keywords:  has-patch         |
------------------------------+------------------

Comment (by simonwheatley):

 Replying to [comment:3 nacin]:
 > I guess wp_update_post() can hypothetically be used to create posts, but
 since wp_insert_post() then assumes if an ID is passed it is dealing with
 an update, things start to get wonky.
 >
 > It would likely be best to fix this in both functions.

 The patch now handles `wp_update_post` and `wp_insert_post`. Same error
 for both.

 > We can use "Invalid post ID." which is an existing string.

 Done.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/23474#comment:5>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list