Make WordPress Core

Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#45258 closed enhancement (duplicate)

Add the_theme_mod() For Displaying Theme Customizations

Reported by: safaris-in's profile Safaris in Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Themes Keywords:
Focuses: Cc:

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
6 years ago

  • Component changed from Customize to Themes
  • Description modified (diff)
  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed
  • Version 5.0 deleted

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
6 years ago

Thank you.

Note: See TracTickets for help on using tickets.