Make WordPress Core

Opened 12 years ago

Closed 12 years ago

#23098 closed enhancement (duplicate)

Make appending paths more DRY

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

Description

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 12 years ago.

Download all attachments as: .zip

Change History (2)

@DrewAPicture
12 years ago

#1 @wonderboymusic
12 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.