[wp-trac] [WordPress Trac] #54185: Cannot have `%s` in default string for `get_theme_mod`

WordPress Trac noreply at wordpress.org
Sun Sep 26 01:29:52 UTC 2021


#54185: Cannot have `%s` in default string for `get_theme_mod`
------------------------------+-----------------------------
 Reporter:  jqz               |      Owner:  (none)
     Type:  defect (bug)      |     Status:  new
 Priority:  normal            |  Milestone:  Awaiting Review
Component:  Customize         |    Version:  trunk
 Severity:  normal            |   Keywords:
  Focuses:  coding-standards  |
------------------------------+-----------------------------
 If the default string passed to `get_theme_mod()` contains `%s` (or
 suchlike) it will be replaced with a URI.  But if it contains `%%s` it
 will be left unchanged and not converted to `%s` (i.e. escaping does not
 work).  There is no way to obtain a literal `%s` in the default string
 (other than by providing one's own implementation of the `get_theme_mod`
 function, which rather defeats the point).

 This has been broken by
 https://github.com/WordPress/WordPress/commit/83edc2476242bebfbe050e3bbf0826cd27b3c8d4

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/54185>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list