Make WordPress Core

Opened 11 years ago

Closed 9 years ago

#24068 closed enhancement (maybelater)

Allow absolute paths to be passed into content_url()

Reported by: westonruter's profile westonruter Owned by:
Milestone: Priority: normal
Severity: trivial Version:
Component: General Keywords: has-patch needs-refresh 2nd-opinion
Focuses: Cc:

Description

It would be very useful if content_url() allowed an absolute path to be supplied just like plugin_dir_url() does. This would allow a script within a theme subdirectory to easily obtain the URL to that subdirectory, for example via content_url(__DIR__), instead of having to add relative paths after get_stylesheet_directory_uri(). This would also allow code living somewhere else under wp-content/ (not in plugins or themes) to likewise obtain its full URL.

http://codex.wordpress.org/Function_Reference/content_url
http://codex.wordpress.org/Function_Reference/plugin_dir_url
http://codex.wordpress.org/Function_Reference/get_stylesheet_directory_uri

Attachments (1)

link-template.php.diff (1.3 KB) - added by westonruter 11 years ago.
Patch to content_url() to allow absolute paths to be passed in

Download all attachments as: .zip

Change History (4)

@westonruter
11 years ago

Patch to content_url() to allow absolute paths to be passed in

#1 @DrewAPicture
9 years ago

  • Keywords needs-refresh added

Patch needs to be refreshed. @westonruter: Still interested in pursing this?

#2 @westonruter
9 years ago

  • Keywords 2nd-opinion added

Nobody has voted for this ticket, so maybe I'm the only one who sees it as being useful.

#3 @westonruter
9 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to maybelater
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.