[wp-trac] [WordPress Trac] #15036: Add 2nd boolean parameter of wp_error to wp_update_post() to allow passthru to wp_insert_post()

WordPress Trac wp-trac at lists.automattic.com
Wed Oct 6 07:16:24 UTC 2010


#15036: Add 2nd boolean parameter of wp_error to wp_update_post() to allow passthru
to wp_insert_post()
--------------------------+-------------------------------------------------
 Reporter:  mikeschinkel  |       Owner:                 
     Type:  enhancement   |      Status:  new            
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Post Types    |     Version:                 
 Severity:  normal        |    Keywords:                 
--------------------------+-------------------------------------------------

Comment(by mikeschinkel):

 Replying to [comment:2 scribu]:
 > The correct way to handle this would be for wp_insert_post() to throw an
 exception, which of course requires PHP 5.

 But since `wp_insert_post()` doesn't throw an exception, let's address
 this issue now for v3.1 and then add the exception logic for v3.2 or
 beyond.  One of the principles I've seen westi quote is ''"Solve the
 problems that exist today using what we have today and then we'll worry
 about "the correct" way to solve it later when it's possible to do so."''
 (at least that's how I remember it.)

 Why do I need this?  I'm currently writing a data import routine that
 reads a file that a sophisticated user creates by hand and imports the
 data as per that file. Unfortunately there are things that can cause the
 data import to fail yet on an update I can't easily report back to the
 user ''why'' it failed like I can on an insert, so I need to be able to
 get the same error result from `wp_update_post()` that I can get from
 `wp_insert_post()`.

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


More information about the wp-trac mailing list