[wp-trac] [WordPress Trac] #23098: Make appending paths more DRY

WordPress Trac noreply at wordpress.org
Tue Jan 1 20:36:17 UTC 2013


#23098: Make appending paths more DRY
-----------------------------+-------------------------
 Reporter:  DrewAPicture     |       Type:  enhancement
   Status:  new              |   Priority:  normal
Milestone:  Awaiting Review  |  Component:  General
  Version:  trunk            |   Severity:  normal
 Keywords:  has-patch        |
-----------------------------+-------------------------
 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.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/23098>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list