Opened 12 years ago
Closed 12 years ago
#23098 closed enhancement (duplicate)
Make appending paths more DRY
Reported by: |
|
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)
Change History (2)
Note: See
TracTickets for help on using
tickets.
Yep - did that here: #22666