#45258 closed enhancement (duplicate)
Add the_theme_mod() For Displaying Theme Customizations
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Priority: | normal | |
| Severity: | normal | Version: | |
| Component: | Themes | Keywords: | |
| Focuses: | Cc: |
Description (last modified by )
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)
Note: See
TracTickets for help on using
tickets.
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.