Make WordPress Core

Opened 9 years ago

Closed 9 years ago

Last modified 6 years ago

#34387 closed enhancement (wontfix)

New function: `the_theme_mod()`

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

Description

For example:

<img src="<?php the_theme_mod( 'logo' ); ?>" alt=""/>

OR

<div><?php the_theme_mod( 'copyright_text' ); ?></div>

Attachments (1)

34387.patch (802 bytes) - added by sebastian.pisula 9 years ago.

Download all attachments as: .zip

Change History (6)

#1 @sebastian.pisula
9 years ago

  • Keywords has-patch added

#2 @swissspidy
9 years ago

You should always escape your output, which is not possible with a generic the_theme_mod function.

I suggest using something like echo esc_url( get_theme_mod( 'logo' ) ) and echo esc_html( get_theme_mod( 'copyright_text' ) ) instead.

#3 @swissspidy
9 years ago

  • Keywords close added

#4 @SergeyBiryukov
9 years ago

  • Keywords close removed
  • Milestone Awaiting Review deleted
  • Resolution set to wontfix
  • Status changed from new to closed

#5 @ocean90
6 years ago

#45258 was marked as a duplicate.

Note: See TracTickets for help on using tickets.