[wp-trac] [WordPress Trac] #41726: `media_handle_upload()` may unexpectedly return 0 on error

WordPress Trac noreply at wordpress.org
Fri Aug 25 13:55:18 UTC 2017


#41726: `media_handle_upload()` may unexpectedly return 0 on error
----------------------------------------+------------------------------
 Reporter:  flixos90                    |       Owner:
     Type:  defect (bug)                |      Status:  new
 Priority:  normal                      |   Milestone:  Awaiting Review
Component:  Media                       |     Version:
 Severity:  normal                      |  Resolution:
 Keywords:  needs-patch good-first-bug  |     Focuses:
----------------------------------------+------------------------------

Comment (by joemcgill):

 Thanks @flixos90.

 `wp_insert_attachment()` has only included the fourth parameter for
 returning a `WP_Error` as of 4.7.0. It's possible that someone is relying
 on the current behavior, but it would indeed be undocumented, as you point
 out. It would make sense for us to make use of the ability to return a
 `WP_Error` from `wp_insert_attachment()` here.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/41726#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list