[wp-trac] [WordPress Trac] #43119: Allow passing empty post ID to media_handle_sideload()

WordPress Trac noreply at wordpress.org
Thu Mar 15 18:47:47 UTC 2018


#43119: Allow passing empty post ID to media_handle_sideload()
--------------------------------------+------------------------------
 Reporter:  swissspidy                |       Owner:
     Type:  defect (bug)              |      Status:  new
 Priority:  normal                    |   Milestone:  Awaiting Review
Component:  Media                     |     Version:  2.6
 Severity:  normal                    |  Resolution:
 Keywords:  has-unit-tests has-patch  |     Focuses:
--------------------------------------+------------------------------
Changes (by birgire):

 * keywords:  needs-patch has-unit-tests => has-unit-tests has-patch


Comment:

 Thanks for patch @AugusGils and the tests @andizer

 In [attachment:43119.2.diff] there are some adjustments:

 - Combines patch + tests into a single patch.
 - To speed things up it avoids the {{{download_url()}}} and uses an
 existing file instead.
 - Changes {{{$default = date( '/Y/m', current_time( 'timestamp' ) );}}} to
 {{{$default = current_time( '/Y/m/' );}}} for simplification.
 - Some changes according to the ''Coding Standard''.
 - Adds cleanups.

 Hope it helps.

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


More information about the wp-trac mailing list