Opened 8 years ago
Closed 8 years ago
#43824 closed defect (bug) (duplicate)
get_theme_mod: sprintf on $default parameter would (wrongly) strip any '%'
| Reported by: | daviedR | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Customize | Version: | 4.9.5 |
| Severity: | normal | Keywords: | |
| Cc: | Focuses: |
Description
Hi,
I noticed that the get_theme_mod function use sprintf on the $default parameter, as seen on this line:
https://core.trac.wordpress.org/browser/tags/4.9.5/src/wp-includes/theme.php#L872
Any % character in the $default string would be stripped.
For example:
get_theme_mod( 'my_theme_mod_key', '100%' ); would return '100' as the default value, not '100%'.
Change History (1)
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Hi @daviedR, welcome to WordPress Trac!
Thanks for the report, we're already tracking this issue in #34290.