Make WordPress Core

Opened 8 years ago

Closed 8 years ago

#23098 closed enhancement (duplicate)

Make appending paths more DRY

Reported by: DrewAPicture Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.6
Component: General Keywords: has-patch
Focuses: Cc:


In working on a plugin recently, I came across a couple of lines in core that effectively append a specified path to a URL in several functions, namely home_url(), content_url(), plugins_url() and so on.

By my count, these same two lines are used in at least 10 functions, so I propose we wrap them into a new append_path function, though the name could be reworked.

As a side note, I'm not a huge fan of assigning $url twice but don't feel like this falls under the pervue of set_url_scheme() at all. Open to suggestions, though.

Patch attached.

Attachments (1)

23098.diff (3.9 KB) - added by DrewAPicture 8 years ago.

Download all attachments as: .zip

Change History (2)

8 years ago

#1 @wonderboymusic
8 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Yep - did that here: #22666

Note: See TracTickets for help on using tickets.