Make WordPress Core

Opened 9 years ago

Closed 9 years ago

#34666 closed enhancement (duplicate)

New function: `template_directory_uri()`

Reported by: sebastianpisula's profile sebastian.pisula Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Themes Keywords:
Focuses: Cc:


Display theme directory URI.

For example:

<img src="<?php template_directory_uri();?>/images/separator.png" />

Attachments (1)

34666.patch (554 bytes) - added by sebastian.pisula 9 years ago.

Download all attachments as: .zip

Change History (3)

#1 @swissspidy
9 years ago

  • Component changed from General to Themes

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 for get_stylesheet_directory_uri()?

#2 @DrewAPicture
9 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #30797.

Note: See TracTickets for help on using tickets.