[wp-trac] [WordPress Trac] #34290: Not possible to have a percent symbol contained in the default value of a theme_mod

WordPress Trac noreply at wordpress.org
Tue Oct 13 14:46:46 UTC 2015


#34290: Not possible to have a percent symbol contained in the default value of a
theme_mod
----------------------------------------+-----------------------------
 Reporter:  kuus                        |      Owner:
     Type:  defect (bug)                |     Status:  new
 Priority:  normal                      |  Milestone:  Awaiting Review
Component:  Customize                   |    Version:  trunk
 Severity:  normal                      |   Keywords:
  Focuses:  javascript, administration  |
----------------------------------------+-----------------------------
 For instance after having added a setting like this

 {{{
 $wp_customize->add_setting( 'my-id', array(
   'default' => '10%',
   'transport' => 'postMessage'
 ));
 }}}

 in the customize screen source code (in the settings JSON) is printed:

 {{{
 s["my-id"] = {"value":"10","transport":"postMessage","dirty":false};
 }}}

 the `%` is stripped out.
 The line responsible for this is: http://git.io/vCz2R
 with the `sprintf` function. I don't know what could be a good fix to
 this.
 Many thanks

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


More information about the wp-trac mailing list