Opened 10 years ago
Closed 10 years ago
#34666 closed enhancement (duplicate)
New function: `template_directory_uri()`
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Priority: | normal | |
| Severity: | normal | Version: | |
| Component: | Themes | Keywords: | |
| Focuses: | Cc: |
Description
Display theme directory URI.
For example:
<img src="<?php template_directory_uri();?>/images/separator.png" />
Attachments (1)
Change History (3)
Note: See
TracTickets for help on using
tickets.
First, you should always escape such output, e.g. by using
echo esc_url( get_template_directory_uri() . '/images/separator.png' ). With your proposed patch, that would not work and I'd highly discourage to use that.Second, why limit this to
get_template_directory_uri()and not also add a similar function forget_stylesheet_directory_uri()?