WordPress.org

Make WordPress Core

Opened 17 months ago

Last modified 5 days ago

#23686 new enhancement

wp_handle_(upload|sideload) have a lot of copy-pasted code from each other

Reported by: nbachiyski Owned by:
Milestone: 4.0 Priority: normal
Severity: normal Version: 3.6
Component: Upload Keywords: has-patch commit
Focuses: Cc:

Description

A huge part of those two functions is the same. It needs to be refactored, so that they share the code.

Attachments (2)

23686.diff (14.9 KB) - added by wonderboymusic 2 weeks ago.
23686.2.diff (13.3 KB) - added by DrewAPicture 5 days ago.
less whitespacing, more docs

Download all attachments as: .zip

Change History (8)

comment:1 DrewAPicture17 months ago

  • Cc xoodrew@… added

wonderboymusic2 weeks ago

comment:2 wonderboymusic2 weeks ago

  • Keywords has-patch added
  • Milestone changed from Awaiting Review to 4.0

23686.diff combines the functions into a helper

comment:3 helen6 days ago

How many of these changes are whitespace/coding standards only?

comment:4 wonderboymusic6 days ago

very few - the 2 funcs use almost the exact same code - it just makes a new function that has that code that the 2 use

DrewAPicture5 days ago

less whitespacing, more docs

comment:5 DrewAPicture5 days ago

  • Keywords commit added

23686.2.diff removes a lot of the whitespacing (sorry Scott :/) and fixes the affected phpDocs.

comment:6 ircbot5 days ago

This ticket was mentioned in IRC in #wordpress-dev by wonderboymusic. View the logs.

Note: See TracTickets for help on using tickets.