Make WordPress Core

Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#45258 closed enhancement (duplicate)

Add the_theme_mod() For Displaying Theme Customizations

Reported by: Safaris in Owned by:
Priority: normal Milestone:
Component: Themes Version:
Severity: normal Keywords:
Cc: Focuses:

Description (last modified by ocean90)

I figure, since a number of customizations are generally displayed, we could have a function that outputs these settings by key. It can echo the result of get_theme_mod()

i.e

function the_theme_mod( $name, $default = false, $language = null ){
 if( is_null( $language ) ){
    echo get_theme_mod( $name, $default );
 } else {
   __( get_theme_mod( $name, $default ), $language );
 }
}

The last argument can be used to optionally pass a language domain for translations or formatting.

Change History (2)

#1 @ocean90
8 years ago

  • Component CustomizeThemes
  • Description modified (diff)
  • Milestone Awaiting Review
  • Resolutionduplicate
  • Status newclosed
  • Version 5.0

Hello @Safaris in, welcome to WordPress Trac!

Thanks for your ticket. This was previously requested in #34387. I'm going to close the ticket as a duplicate and confirm the concerns mentioned in #34387 are still valid.

P.S: You can't use __( ) like in your example. Take a look at our handbook if you want to learn more about internationalization.

#2 @Safaris in
8 years ago

Thank you.

Note: See TracTickets for help on using tickets.